1.0.10 • Published 4 years ago
passport-apple-tb v1.0.10
passport-apple-tb
Passport strategy for authenticating with Apple using the OAuth 1.0a API.
This module lets you authenticate using Apple in your Node.js applications. By plugging into Passport, Apple authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.
Install
$ npm install passport-apple-tb
Usage
Create an Application
Before using passport-apple-tb
, you must first get an apple key. If you
have not already done so, an API key can be requested at internal.
Your will be issued an API key and secret, which need to be provided to the
strategy.
Authenticate Requests
Use passport.authenticate()
, specifying the 'apple'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app.get('/auth/apple',
passport.authenticate('apple'));
app.get('/auth/apple/callback',
passport.authenticate('apple', { failureRedirect: '/login' }),
function(req, res) {
// Successful authentication, redirect home.
res.redirect('/');
});