-
Notifications
You must be signed in to change notification settings - Fork 48
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
Cannot get email & name while scopes requested on IOS14 #33
Comments
The same thing happens to me. Even Apple rejected my app, arguing that the registration using sig in with Apple should save the user the process of typing their name and email. Still, even if I follow the instructions correctly, I cannot obtain that from Apple Sig In. |
use jwt_decode to get email....but i don't know how to get full name |
We are also experiencing this issue with our app! Would be nice to see this issue addressed |
This is not an issue, but how Sign in with apple works. Email in the token is provided by Apple only on first request, for tokens received later you need to use Apple's REST API to exchange token for user details. |
Do you have a detailed example @faugusztin ? |
https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens You get your tokens from sign in, then you validate the authorization grant code, from which you get the JWT claim and a refresh token. For any future communication with the sign in REST servers you send the refresh token (Validate an Existing Refresh Token), as the authorization grant code is invalidated after trading it for a refresh token. If i remember correctly i used the https://github.com/aaronpk/sign-in-with-apple-example as a start on how to use the Apple REST API. Unfortunately i don't have any code to give out to translate the Ruby/PHP code examples into JS or Objective C/Swift, that is up to you if you need to do it on device. Edit: Just a note, to generate client_secret while communicating with the REST API one needs to use a private key, which is why it is not a good idea to perform this communication in the app itself, but instead on a well secured backend server. |
Login works fine and we can able to get email by decoding Identity token like this.
OUTPUT : But not able to get name.. Any help? |
This. The user object is sent only the first time, then the email can be extracted from the jwt. |
Hello Guys, We noticed that after users authenticate their account with Sign in with Apple, they are required to take additional steps before they can access content and features in your app. Specifically:
Thanks in advance |
@dhayaljaswantgit you can get the
|
Work to me, Thanks <3 |
Per apple's documentation: Link here The user must remove the app from their settings -> Profile -> password & security -> apple id logins, for us to ever receive that information again. They are rejecting my app on the same basis, because they are too <redacted word> to clear the app from their test device prior to testing the app, and don't know their own documentation. But for now my approach is to simply notify the user with a popup saying "hey, you already authenticated once before, we can't get your full name per Link here". |
Yes Got that, Thanks @kurybr |
It seems like even at the first login, the name is now missing? Anyone else faces that issue? |
yes, i am having the same problem. fullName and email always return empty results. |
I'm not having any problems with this plugin on my iPhone 13, iOS v 15.5, Xcode v 13.3.1. It is behaving as documented by Apple. On 1st login email, family name (last name) and given name (first name) if shared, are populated. This data should be persisted to your server and/or stored in a persistent location on the device ( IndexedDB or a local SQLite DB are a few ideas that come to mind). On subsequent logins, those properties are returned as null strings. The returned user property (user id) is consistent in both cases and thus should be used to lookup the users persisted data. The only way to logout the user and receive the users email and name info once again is for the user to go into settings on the device and click on their name (account), tap on password & security then tap on apps using Apple ID, then tap on the app and finally tap on Stop Using Apple ID. The next time the app is launched, the users info (if shared) will be included once again since as far as the device is concerned, this is the first login with Apple ID. |
No problems here either, iPhone SE (2020), iOS 14.5, Xcode 13.2.1 |
it works fine previously where users get to give permission to plugin for email and fullname,
this.signInWithApple.signin({ requestedScopes: [ ASAuthorizationAppleIDRequest.ASAuthorizationScopeFullName, ASAuthorizationAppleIDRequest.ASAuthorizationScopeEmail ] })
but now, when sign in using apple, the request permission page is gone, and it just sign in using a masked email
The text was updated successfully, but these errors were encountered: