TransWikia.com

Sign-in with Apple user verification

Information Security Asked on November 8, 2021

I want to enable "Sign-in with apple" in my application.

Apple sign-in

As you can see here App sends Token authorization code to the backend, and then backend needs to talk with Apple ID to verify the user.

This is the recommended way from iOS docs, but I noticed when the app calls the "Sign in with Apple" function it gets a JWT which is cryptographically signed by Apple, and it contains user email + user ID. (ASAuthorizationAppleIDCredential-> identityToken)

I can just validate Apple’s signature, and decode the JWT and I KNOW the identity of the user handing over the token to me and I know that JWT is valid because apple’s signature match.

My question is why do I need to deal with network requests + authorization codes, just to verify user’s identity, when I can do it locally on my backend just with algorithms + Apple’s public key.

I can see why this flow is good when I need to access apple API About the user later (let’s say updating some info about them or adding something to their calendar) but just for sign-in, this feels like an overkill.

https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidcredential/3153035-identitytoken

a useful link about validating the JWT: https://sarunw.com/posts/sign-in-with-apple-3/

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP