Has anyone added Sign in with Apple to their app?

  1. 35.0.0
  2. iOS

Hi, everyone.

Has anyone here managed to get Sign in with Apple set up and working properly in their Expo app? I seem to have the majority of it working as expected but when trying to validate the authorizationCode via Apple’s auth endpoint, I’m getting invalid_grant. I’ve come across others who are using the service fine with their web apps so I’m wondering if there’s an issue with my implementation (regarding redirect_uri, etc.).

In my Apple Developer portal, I have a service set up with my Expo redirect_uri set as the Return URL but I’m still getting the bad response when validating.

Looking at Expo’s docs, it doesn’t mention validating this way (despite the Apple docs saying to do so). Instead, it says:

Apple’s response includes a signed JWT with information about the user. To ensure that the response came from Apple, you can cryptographically verify the signature with Apple’s public key, which is published at https://appleid.apple.com/auth/keys. This process is not specific to Expo.

Is this the definitive way to go when doing this with Expo then and should I avoid using Apple’s auth endpoint? If so, despite it not being specific to Expo, can anyone offer any advice on how to verify the authorizationCode as mentioned above. I’m learning this stuff as I go.

Up until now, I’ve been following this article about Sign in with Apple and Expo.

Thanks!

I saw that you wrote some of AppleAuthentication documentation, @ide. Apologies for pinging you directly but if you have a minute I’d love your input. I’ve been trying to get help with this for a couple of days (Slack and on here) but haven’t had much luck. Thank you! :slight_smile:

Looking at this briefly, it looks like Apple is telling you to look at the same endpoint we are. Use one of the pubkeys at that endpoint.