[ad_1]
I am writing a small app which requires person accounts and authenticating in opposition to a distant backend (REST API) which belongs to the app.
What I’ve completed up to now, is including the “Check in with Apple” button to my SwiftUI and receiving a ASAuthorization object containing person, IdToken, AuthCode, …
When a person indicators within the first time, I’ve to create an account within the backend, saving the userId and Title. This and all future calls to my backend API I need to safe by utilizing the IdToken as Bearer for Authentication. My backend will confirm the token as described right here.
For me, it isn’t clear easy methods to refresh the IdToken in my App with out asking the person once more for his register (just like the button does). Or what ought to I save on the customers’ gadget that he has to not register after restarting the app. This documentation saves the userid within the Keychain and tries to get the userid once more on app begin – however the place is the idToken / what if the idToken is expired?
[ad_2]
