I'm unable to sign in with Apple and Supabase Authentication from my iOS app.
Future<AuthResponse> _signInWithApple() async {
final rawNonce = supabase.auth.generateRawNonce();
final hashedNonce = sha256.convert(utf8.encode(rawNonce)).toString();
final credential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
nonce: hashedNonce,
);
final idToken = credential.identityToken!;
if (idToken == null) {
throw const AuthException('Could not find ID Token from generated credential.');
}
try {
return supabase.auth.signInWithIdToken(
provider: OAuthProvider.apple,
idToken: idToken,
nonce: rawNonce,
);
} catch (e) {
throw AuthException(e.toString());
}
}
There was an change made on the Apple API, and older versions of Gotrue (Supabase Auth server) will throw this error. You can update the gotrue version manually, or wait until the new version is rolled out.