A sample implementation of Sign in with Apple using ASP.NET Core
APACHE-2.0 License
This repository contains a sample implementation of Sign in with Apple for ASP.NET Core written in C#.
Sign in with Apple is a way of allowing users of websites to sign in using their Apple ID.
This example integration shows a minimal sample of how to integrate Sign in with Apple a website to authenticate a user using their Apple ID and retrieve their email address (or a relay address to it) and their name.
To setup the repository to run the sample, perform the steps below:
git clone https://github.com/{username}/SignInWithAppleSample.git
apple-developer-domain-association.txt
) in the src\SignInWithApple\wwwroot\.well-known
folder..p8
file contining the private key to generate the client secret to the root of the application in src\SignInWithApple
(but not in the wwwroot
folder), or use some other mechanism, such as loading it from a blob storage account.src\SignInWithApple\wwwroot\favicon.ico
) to your own design.src\SignInWithApple\appsettings.json
:
AppleClientId
AppleKeyId
AppleTeamId
You should now be able to sign in with your Apple ID in the deployed application.
You should be able to debug the application in Visual Studio Code or Visual Studio 2022 (17.3 or later).
If you are deploying the sample application to a Microsoft Azure App Service Web App, you will need to make the following configuration changes to your Web App for the sample application to run correctly:
ℹ️ The Free and Shared pricing tiers do not support features required to load the private key. See the Azure App Service documentation for the the other available pricing tiers.
WEBSITE_LOAD_USER_PROFILE
to a value of 1
.{yourappname}.azurewebsites.net
or a custom hostname that you have set up) has been added in the Apple Developer portal to your service id and you've added the Apple Developer domain validation file as described in the Setup section above.Any feedback or issues can be added to the issues for this project in GitHub.
This project is licensed under the Apache 2.0 license.