amplify-js: Amplify with Apple Sign in using Expo: NotAuthorizedException: Invalid login token. Issuer doesn't match providerName
** Which Category is your question related to? ** Auth ** What AWS Services are you utilizing? ** Cognito, AWS Amplify ** Provide additional details e.g. code snippets ** Hi I am trying to use Amplify SignInWithApple together with Expo SDK v36 for my react-native app and I am getting
NotAuthorizedException: Invalid login token. Issuer doesn’t match providerName
when trying to authenticate.
I am currently using Amplify “aws-amplify”: “2.2.0”, “aws-amplify-react-native”: “2.2.3” and “expo”: “36.0.0”, “expo-apple-authentication”: “2.0.0”.
this is the code I am using to authenticate wit expo apple authentication then pass it to amplify to avoid using the Hosted UI as the user experience is not that good with the Hosted UI.
async () => {
try {
const result = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL
]
});
const { exp } = jwt_decode(result.identityToken);
try {
await Auth.federatedSignIn(
"SignInWithApple",
{
token: result.identityToken,
expires_at: exp * 1000 + new Date().getTime()
},
{
name: `${result.fullName.givenName} ${result.fullName.familyName}`,
firstName: result.fullName.givenName,
lastName: result.fullName.familyName,
email: result.email
}
);
this.props.navigation.navigate("Home");
} catch (e) {
console.log("Amplify apple login error => ", e);
}
// signed in
} catch (e) {
if (e.code === "ERR_CANCELED") {
// handle that the user canceled the sign-in flow
console.log("user canceled apple sign in => ", e);
} else {
// handle other errors
console.log("error during sign in with Apple via expo => ", e);
}
}
}
The Expo auth with Apple works perfectly and returns the identityToken that is then passed to Amplify. I have configured Apple provider in User pool but still getting the error message. Can someone help?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (1 by maintainers)
@kevinpiske Are there anybody that have implemented the apple login on amplify-auth?
can you show your code working without this issue “Invalid login token. Issuer doesn’t match providerName” with signinWithApple in my case the everything it setup correctly but still the error shows"
never resolved amplify does not show any documentation for signinWithApple even if it says it is supported! 😦
This is still very much an issue, this should not be closed.
@DatMoser - can you please submit a new Github issue so that we can investigate this further?
Is this already solved ? I am also having this issue
I have the same issue. My client_id match both side. It’s work with appleid.apple.com instead of SignInWithApple but I would like to have Apple user in User Pool instead of Identity Pool, is it possible ?
@dabit3 any idea how to solve this? thanks