-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple sign-in mix between id and token #5890
Comments
Nice catch! Feel free to submit a PR. Where do you get credential.user? Also can you add support for private key as discussed here? |
@dplewis I don't know what it is about... I can't see anywhere in Apple's doc how the private key could replace the public key. I'm guessing it's two completely different subject: the public key is need for the JWT validation, and the private key is needed to obtain new tokens (??) |
@SebC99 Just checked you are right, you can ignore that. |
@dplewis I think the iOS and the JS version is not really the same, so the |
The JS Version returns a user but its a JSON string here The Rest API Version returns
In both cases if a developer wanted a identifier they would have to decode the JWT and use the sub field as you mentioned. Here is how I decode
The solution you have is valid but we should document how to get the identifier. |
You're right, in JS, it's easy to obtain the id with |
In #5755, it is said that the authData should be:
whereas the authAdapter's id should be a unique id to recognized the user.
The Apple JWT is always changing since it includes the time and the Apple Public Key, so we have to use the Apple
credential.user
as the id and the JWT (identityToken
) as the token/access_token.And then, when the server inspects the JWT, we can check if the
sub
element is equal to theid
In the current version, every login causes a user creation.
I can try to to a PR if you want
(btw, great work for this implementation!)
The text was updated successfully, but these errors were encountered: