Skip to content
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

Email is missing in JWT returned from Apple SSO #46

Open
realkoder opened this issue Sep 19, 2024 · 3 comments
Open

Email is missing in JWT returned from Apple SSO #46

realkoder opened this issue Sep 19, 2024 · 3 comments

Comments

@realkoder
Copy link

Hi there,

I have been troubleshooting an issue for several days and would appreciate any insights you might have. When using the apple-auth library, I'm able to receive all necessary data from Apple without encountering any HTTP errors or exceptions. However, I am not receiving the email field in the decoded JWT payload from response.id_token.

Interestingly, this issue only occurs for users other than myself. When I use my own Apple ID, which is connected to my Apple Developer account (where all configurations are stored), I receive the email without any problems. However, for other users, the email field is missing in the JWT payload.

Has anyone experienced a similar issue, or does anyone know how to resolve this?

Thank you in advance for your help.

Best regards,
Alexander

@ananay
Copy link
Owner

ananay commented Sep 19, 2024

hi @realkoder, the email and other profile is shared only once (when the person registers). At that time, you're supposed to store the email and all other details. After subsequent logins, you'll only get the sub parameter from Apple which is the unique identifier. You have to match the sub parameter from response.id_token with the email stored by your DB during the first login.

@realkoder
Copy link
Author

realkoder commented Sep 20, 2024

Thanks a lot for getting back to me this fast! Really appreciated

I've read that before so I am aware that first signin for client is the only time where name is returned didn't know it's the same with the email.
But how come every time when I use my own AppleId for Apple SSO
I get my email returned in the JWT? Could that be because my appleId is connected to the apple dev account I'm using?

Sorry for my confusion 🤪

@realkoder
Copy link
Author

Okay never mind - I just thought that the email was returned every time a client would sign-in using Apple SSO.
I'm just an idiot.... This means my setup has worked for a long time now hahahah, which I didnt believe it did... :')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants