Sign In with Apple in Xojo

Apple offers the possibility to use an Apple Account to sign-in to your service. They basically let the user authenticate and then provide you with a token linked to the user’s Apple Account.

see Sign in with Apple and Implementing User Authentication with Sign in with Apple

To show the user, that they can sign-in with Apple, you can have a button in your window and use one of three designs:

Once clicked, you can use ASAuthorizationControllerMBS class to show a dialog for the user to confirm their account. If you application asks for email or user name with the options for the service, the user can choose whether they like to directly share the email address or use an alias.

Once sign-in is done, you receive a didCompleteWithAuthentication event with the ASAuthorizationAppleIDCredentialMBS object containing the information for you. This includes the user name, the shared email and a token to store in your database as identifier. If available, there is a status on whether this is a real user (not fake) and whether this is a child account.

If you like to implement this, please check the readme and Apple documentation. You will certainly need to make a matching Xcode project with the same bundle identifier, so Xcode can create the required mobile profile.

2 Likes