Setup Auth Server
When implementing Sign in with Apple on Android devices you need to setup a server that will receive the authorisation code and return data to the application. This server application catches the user data posted by Apple and passes it to the extension. The extension will then use this information to further gather the identity token and user identifier.
The below is an NodeJS example (taken from https://github.com/johncodeos-blog/SignInWithAppleBackendServer) which works with our implementation of Sign In with Apple on Android.
This needs to be installed the server redirect url that you verified earlier and you should change the
/appleoauth endpoint to match your needs.
To correctly setup the application you will need to enter all the information you gathered earlier into the
.env configuration file, including the filename of the key (
p8 file) that you created. You must upload this file to the server alongside this code making sure it's not publicly accessible.
If you wish to create your own version, you can use the logic in the below code.