react-apple-signin-auth
Apple signin for React using the official Apple JS SDK
Prerequisites
- You should be enrolled in Apple Developer Program.
- Please have a look at Apple documentation related to "Sign in with Apple" feature.
- You should create App ID and Service ID in your Apple Developer Account.
- You should generate private key for your Service ID in your Apple Developer Account.
Apple Signin Setup
Deatiled confuguration instructions can be found at blog post and Apple docs and official apple docs for webpage signin.
Installation
OR
Usage
Checkout the demo for a quick start!
Note about the response's user
object
onSuccess
response object will contain the user object on the first time attempt only. Meaning if you make another signIn attempt for the same account you will not get the user object.
Raw JS functionality
a module called appleAuthHelpers
is also exported to allow you to use the functionality without using the UI or relying on React. This works with any kind of frontend JS, eg: react, vue, etc... Note that you need to load the apple script yourself.
- Importing the apple script:
- Using appleAuthHelpers:
Server-side authentication (nodeJS backend)
Another library exists for server/backend support for Apple signin apple-signin-auth
Usage
- Install the library
yarn add apple-signin-auth
ORnpm i apple-signin-auth
- Implement JWT verification logic
Further resources:
Related Projects
Contributing
Pull requests are highly appreciated! For major changes, please open an issue first to discuss what you would like to change.
Getting Started
- Clone the repo:
git clone https://github.com/a-tokyo/react-apple-signin-auth
- Install deps:
yarn
- Start webpack development server on localhost:3001:
yarn start
- To run/update the tests locally, run:
yarn test -u