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

HowTo: Retrieve user information. #28

Open
thewayibyte opened this issue Oct 22, 2022 · 4 comments
Open

HowTo: Retrieve user information. #28

thewayibyte opened this issue Oct 22, 2022 · 4 comments

Comments

@thewayibyte
Copy link

Hello,

can you please tell me how I can retrieve some additional user information?
I have received the initial token and then I received a successful response of type "AppleAuth.TokenObjects.AuthorizationToken" in the method "HandleResponseFromApple", is there a way to get user first name and last name?

Thanks

@DanailStoichkov
Copy link
Collaborator

You can get the token only the first time the user logs into your app using Sign in with Apple or if you revoke their token (See AppleAuthProvider.cs > RevokeToken method). Then the user will be prompted to a screen where they can choose if they want to share their email or not. After they click continue, in the initial request to your endpoint URL (the one that you have defined in your apple developer portal) will receive a request that contains also a user object:
image

@drgrieve
Copy link

This apple feature had me confused for much longer than needed.

For far too long I though the user info was in the jwt id_token.

You can easy miss the one time field when you first start programming Apple outh.

Please consider adding to wiki.

@DanailStoichkov
Copy link
Collaborator

DanailStoichkov commented Oct 25, 2022

@drgrieve You only have the user email there (if the user decides to share it with you). I will put up a schema that depicts the whole sign in flow.

@Evon-Simran
Copy link

Is there any way to reterive user details from apple server using sub or userid

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

4 participants