ZionniteOriginal post
Rank 4: Virtual Machine
Hello Appwriter,
i'm creating an OAuth Login with Apple, i have configure everything on my Apple Developer Account and in my Appwrite Console,
When i Login with Apple, the user Full name and Email is Created in the Appwrite Cloud Cosole (Auth)
I dont know what's wrong in my code, i keep getting this error response:
Plain text
GOING TO ROUTE /Appflutter: #0 ClientIO.webAuth.<anonymous closure> (package:appwrite/src/client_io.dart:371:9)flutter: <asynchronous suspension>flutter: #1 AppwriteService.loginWithOAuth (package:prayerbuddynewlook/services/appwrite_service.dart:88:7)flutter: <asynchronous suspension>flutter: #2 AuthController.loginWithOAuth (package:prayerbuddynewlook/controllers/auth_controller.dart:41:7)flutter: <asynchronous suspension>```
**here is my Appwrite Services:**
```Future<void> loginWithOAuth(String provider) async { try { final redirectUri = 'https://prayerbuddyapp.joons-me.com'; await account.createOAuth2Session( provider: _mapProvider(provider), // 'facebook', 'google', 'apple' success: '$redirectUri/loginSuccess', failure: '$redirectUri/loginFail', ); _currentUserId = null; } catch (e, s) { debugPrint('OAuth login error: $e\n$s'); throw Exception('OAuth login failed'); } }
OAuthProvider _mapProvider(String name) { switch (name.toLowerCase()) { case 'google': return OAuthProvider.google; case 'facebook': return OAuthProvider.facebook; case 'apple': return OAuthProvider.apple; // add more if you need them default: throw Exception('Unknown provider $name'); }```Summary
Developers are getting an error message saying "Key and Secret not available" when using Appwrite OAuth2. The issue seems to be with the OAuth configuration and redirect URI setup.
**Solution:** The error might be due to missing keys or secrets in the OAuth configuration. Double-check the OAuth configuration and ensure that the necessary keys and secrets are provided. Double-check the redirect URI setup in the Appwrite services to ensure it matches the configuration on Apple's Developer Account and Appwrite Console.