Skip to content

ananay/passport-apple-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 [Example] Sign in with Apple for Passport.js

Follow @ananayarora

This repository is a how-to-use example for my library – passport-apple

Check it out here:

https://github.com/ananay/passport-apple

https://npmjs.com/package/passport-apple

Live on https://passport-apple.ananay.dev

Configuring

Make sure you've followed the configuration guide here!

Setup your Apple Developer Account as follows:

https://github.com/ananay/apple-auth/blob/master/SETUP.md

Configure the parameters here:

passport.use(new AppleStrategy({
    clientID: "",
    teamID: "",
    callbackURL: "",
    keyID: "",
    privateKeyLocation: ""
}, function(accessToken, refreshToken, idToken, profile, cb) {
    // Here, check if the idToken.sub exists in your database!
    if (req.body && req.body.user) {
      // Register your user here!
      console.log(req.body.user);
    }
    cb(null, idToken);
}));

Also make sure you've placed your AuthKey file in the config folder as well!

Questions / Contributing

Feel free to open issues and pull requests. If you would like to be one of the core creators of this library, please reach out to me at i@ananayarora.com or message me on twitter @ananayarora!

Created with ❤️ by Ananay Arora

About

Passport Strategy for Sign in with Apple Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published