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

Login with Apple from iOS to API #41

Open
joey-barbier opened this issue Oct 26, 2022 · 3 comments
Open

Login with Apple from iOS to API #41

joey-barbier opened this issue Oct 26, 2022 · 3 comments

Comments

@joey-barbier
Copy link

Hello,

I need your lights, my users login from an iOS device, after using "sign in with Apple" I get a token so I send it to my API but when I try to use $client->fetchUserFromToken($accessToken); I get an empty user.

League\OAuth2\Client\Provider\AppleResourceOwner {#541
  #response: array:2 [
    "email" => null
    "isPrivateEmail" => null
  ]
  #resourceOwnerId: null
  -email: null
  -isPrivateEmail: null
}

Do you have a solution?

Thank you!

@patrickbussmann
Copy link
Owner

You get this information only at very first request. Not on second or third one.

@joey-barbier
Copy link
Author

joey-barbier commented Oct 27, 2022

Oh yes.. my bad, but how can I check if the token is valid ?

@joey-barbier
Copy link
Author

To complete my question, I use your SDK with "knpuniversity/oauth2-client-bundle", to check a validity of JWT received from an iOS device, I need to do it like this:

"https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/verifying_a_user" :

  • To verify the identity token, your app server must:
  • Verify the JWS E256 signature using the server’s public key
  • Verify the nonce for the authentication
  • Verify that the iss field contains https://appleid.apple.com
  • Verify that the aud field is the developer’s client_id
  • Verify that the time is earlier than the exp value of the token

Or you have a method already developed?

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