Giter Club home page Giter Club logo

signinwithapplesample's Introduction

Sign in with Apple Example Integration

Build status

This repository contains a sample implementation of Sign in with Apple for ASP.NET Core written in C#.

Overview

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.

Setup

To setup the repository to run the sample, perform the steps below:

  1. Install the .NET SDK, Visual Studio or Visual Studio Code version compatible with .NET 7.
  2. Fork this repository.
  3. Clone the repository from your fork to your local machine: git clone https://github.com/{username}/SignInWithAppleSample.git
  4. Follow the steps to obtain your Client ID, Private Key, Key ID and Domain Verification file, if you do not already have them.
  5. Place the Domain Verification file (apple-developer-domain-association.txt) in the src\SignInWithApple\wwwroot\.well-known folder.
  6. Either add your .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.
  7. Update the favicon (src\SignInWithApple\wwwroot\favicon.ico) to your own design.
  8. Configure the following settings as appropriate in either your environment variables or in src\SignInWithApple\appsettings.json:
    • AppleClientId
    • AppleKeyId
    • AppleTeamId
  9. Deploy the application to the hosting environment for the domain where you wish to use Sign in with Apple.
  10. Verify the domain in the Apple Developer Portal.

You should now be able to sign in with your Apple ID in the deployed application.

Local Debugging

You should be able to debug the application in Visual Studio Code or Visual Studio 2022 (17.3 or later).

Azure App Service Deployment

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.

  • Navigate to the Application settings tab of your Web App and add the following settings:
    • WEBSITE_LOAD_USER_PROFILE to a value of 1.
    • Save the changes.
  • Ensure the hostname you are using (either {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.

Feedback

Any feedback or issues can be added to the issues for this project in GitHub.

License

This project is licensed under the Apache 2.0 license.

External Links

signinwithapplesample's People

Contributors

costellobot avatar costellobot[bot] avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar martincostello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

signinwithapplesample's Issues

Integration of This With Azure B2C?

Those of us using Azure B2C for Sign in With Apple are struggling with it a bit since it doesn't return all of the values from the Apple callback that your script does. Particularly, the First Name, Last Name, Email Address (even if anonymized with Private Email feature) since that only gets sent once during the initial signup. Sign in With Apple seems to be kind of a half baked idea with them and we're not sure why they're dragging their feet on this. Is there any chance that we can take aspects of your script and make it work with Azure B2C to capture that info in the callback?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.