Apple sign-in

A step of the Cloud application tree on Gradus, in the Security area: Secrets, auth, TLS, input.

Let users sign in with Apple, whose client secret is a JWT you renew and whose name arrives only once. Needs an Apple Developer account.

Usually comes after: Google sign-in.

Prompt for your AI assistant

Read docs/product/users.md and the sign-in decision record in docs/decisions. If these users have no reason to expect Apple, say so. If I have no Apple Developer account, stop and tell me. Add Sign in with Apple for the web: the App ID, the Services ID, the signing key kept as a secret and a callback URL on the product's domain. On a hosted provider, use its Apple connection with these keys. In your own service, use a maintained library, and remember that the client secret is a JWT you sign yourself with a lifetime of at most six months, so generate it so it can never lapse unseen. Apple sends the user's name only at the first authorization, so store it then. Store the identity by subject. Check Apple's current docs on hidden addresses and how to send mail to them, and never link to an existing user by a hidden address. Test with a real Apple account, including removing the app from the account and signing in again.

This is https://gradus.kazet.blog/tree/cloud-application/step/apple-sign-in as plain HTML. In a browser the page also lets you mark the step forged and copy a message for your AI assistant.