The Apple Provider comes with a set of default options:
You can override any of the options to suit your own use case.
There are two ways you can use the Sign in with Apple provider.
If you use a dynamically generated secret you never have to manually update the server.
You can convert your Apple key to a single line to use it in an environment variable.
If you use a pre-generated secret you can avoid adding your private key as an environment variable.
The TeamID is located on the top right after logging in.
The KeyID is located after you create the Key look for before you download the k8 file.
Apple requires all sites to run HTTPS (including local development instances).
Apple doesn't allow you to use localhost in domains or subdomains.
The following guides may be helpful:
You will need to edit your host file and point your site at
On Windows (Run Powershell as administrator)
Creating a certificate for localhost is easy with openssl . Just put the following command in the terminal. The output will be two files: localhost.key and localhost.crt.
The OpenSSL executable is distributed with Git for Windows.
Once installed you will find the openssl.exe file in
C:/Program Files/Git/mingw64/bin which you can add to the system PATH environment variable if it’s not already done.
Add environment variable
certificates and place
You can create a
server.js in the root of your project and run it with
node server.js to test Sign in with Apple integration locally:
If you want to pre-generate your secret, this is an example of the code you will need: