Closed jtormey closed 3 years ago
Thanks @jtormey!
I've fixed it in #86, but haven't had the chance to test it out. Let me know if it works for you!
The reason I did it this way is that Apple for the most part adheres to the OIDC specs but not always. This is one such case. As I understand it, OIDC only permits code
, state
, and sometimes id_token
to be returned in the auth code flow. OAuth 2.0 does permit additional params but they have to be explicitly recognized. And on top of that the value for the query param is JSON encoded.
Anyway, I hope this resolves your issue!
v0.1.25
has been released, thanks!
When using the
"name"
scope with sign-in with Apple, it doesn't seem like the"user"
map that contains"firstName"
and"lastName"
is decoded, or added to thetoken
map inOAuth2.callback/3
. This means that whenStrategy.Apple
attempts to merge the name params into the other user params, nothing is there. In my application this results in"given_name"
and"family_name"
being absent when trying to insert a new user into the database.I was able to fix this in my project by decoding the
"user"
map inOAuth2.callback/3
, and assigning it totoken
before passing it off tofetch_user_with_strategy
as follows:Does this seem right? I've looked pretty closely at the code paths involved, and don't see any other place where this information seems to be handled. Happy to open a PR if this is a real issue, and if the fix seems appropriate!