#Apple Sign in nestjs not working

7 messages · Page 1 of 1 (latest)

tribal citrus
#

I am implementing Sign in with Apple using the NestJs framework.
When the user (me, right now) signs in for the first time, I get data I need!
The parameters look like this

Parameters:

{"state"=>"[state]", "code"=>"[code]", "id_token"=> "[jws token]", "user"=>"{\"email\":\"[the email I need]\"}"}
My scope is just "email," I don't need (or want) their name.

Next, I try signing in again (same everything)
But, I get this option
When I click "continue" the data looks like this

Parameters:

{"state"=>"[state]", "code"=>"[code]", "id_token"=> "[id token]"}
As you can tell, there is no user object, no email, nothing I can use!

If I do the code response and get an access token, I can't use it. There's no public, known endpoints to just get the email they used. There's no point in storing the email if I can never check for it the next time they sign in.

On my iPhone running iOS 13 developer beta 3, every time I click the button, I get the option to "share" or "hide" my email (even though, as shown above, I've sign in before), and sharing the email actually shares it, while hiding it.. well hides it.

However, the user data is always there.

Followed this article
https://blog.devgenius.io/how-to-implement-apple-login-with-nestjs-in-seconds-b88f05abe847
After id_token generation no further process has been written that how to validate user on again sign in with apple

Thanks for any help you can provide.

Medium

Nestjs is a framework for building efficient, scalable Node.js server-side applications. It uses modern JavaScript, is built with…

tribal citrus
#

anyone can help on this?

tribal citrus
#

@flint tulip sorry for the tag but I am currently working on this if you can kindly provide any help on this I will be grateful

grand quail
#

There is no way for you to find out the original apple email, the best way is that always use the Apple account id to associate to your user account.

When users register via apple in your app, you need to store the record somewhere and associate the apple id with the e-mail you received. On further logins, you can get the stored e-mail via the apple id.

#

It's always a good practise to store user records even though they registered or logged in via a 3rd party service

#

(the apple id should be encoded in the id_token JWT if I'm not mistaken)

finite orbitBOT
#

Please do not tag the moderators unless someone is breaking server rules. The mods are here to help enforce the rules of the server, and while most of them are knowledgeable about Nest, they are not the only ones able to solve your question.