nickpinheiro / aspnet-sign-in-with-apple

Sample solution for implementing 'Sign in with Apple' using both ASP.NET Core MVC and Razor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sign in with Apple using ASP.NET Core (MVC & Razor Pages)

In 2019 Apple announced and released 'Sign in with Apple' (SIWA) at their Worldwide Developer Conference (WWDC). 'Sign in with Apple' is the fast, easy way for people to sign in to apps or websites using the Apple IDs they already have. In doing so Apple joined many other OpenID and OAuth identity providers including Facebook, Google, Microsoft, Amazon and others. Business and data platform Statista estimates that 20 percent of all smartphones sold worldwide in 2019 were an Apple iPhone. Apple has consistently been Samsung’s closest competitor, maintaining the position of second most popular smartphone vendor in the world since 2012. Providing authentication from external identity providers is of great value to your app or website as it simplifies access and increases usage. With just a click or two, new users are able to sign in and begin using your app or website without creating a new username and password.

In this repository I have provided sample projects for implementing 'Sign in with Apple' using both ASP.NET Core MVC and Razor Pages.

Features

  • Retrieve and display the Id, First Name, Last Name, Full Name and Email Address of the Apple ID user
  • Supports both Apple Face ID authentication and Apple ID username and password authentication
  • Supports Apple ID Multi-Factor Authentication (MFA)
  • Handle the initial Apple ID sign in and all subsequent sign ins as the data response is slightly different
  • Redirect the user back to your website using the Redirect Url

Preview Images

Sign In With Apple Sign In With Apple Sign In With Apple

Configuration

In order to configure your web app to support 'Sign in with Apple' (SIWA) you must have an active Apple Developer Account https://developer.apple.com/account

Once you have an active account you must create an App ID, Identifier and Service ID. The following is the Apple documentation for undergoing this process: https://help.apple.com/developer-account/#/dev1b35d6f83

Your 'Identitfier' will service as your client_id and you must enter a Domain and Return URL for your web app in the Web Authentication Configuration popup window of the 'Edit your Service Configuration' page of your Identifier in the Apple Developer portal. The only two configuration values you need to enter here are in the appsettings.json file of each project:

  • ClientId
  • RedirectUri

Live Demo Sites on Microsoft Azure

ASP.NET Core MVC
https://aspnet-apple-web-mvc.azurewebsites.net

ASP.NET Core Razor Pages
https://aspnet-apple-web-razor.azurewebsites.net

Subscribe for Updates

Subscribe for notifications of updates and new features:
https://www.iamnickpinheiro.com/#subscribe

Resources

Introducing Sign In with Apple (WWDC Video)
https://developer.apple.com/videos/play/wwdc2019/706

Incorporating Sign in with Apple into Other Platforms
https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms

Apple ID | Manage your Apple account
https://appleid.apple.com

License

Sign in with Apple using ASP.NET Core (MVC & Razor Pages) is licensed under the MIT license. See the LICENSE file for more details.

About

Sample solution for implementing 'Sign in with Apple' using both ASP.NET Core MVC and Razor.

License:MIT License


Languages

Language:C# 93.9%Language:HTML 3.8%Language:CSS 2.0%Language:JavaScript 0.3%