passport-openid-oauth20
Passport strategy for authenticating with OpenID providers using the OAuth 2.0 API.
Install
npm install passport-openid-oauth20
Usage
Configure Strategy
The strategy requires a verify
callback, which receives the access token and optional
refresh token, as well as profile
which contains the authenticated user's
OpenID profile. The verify
callback must call cb
providing a user to
complete authentication.
var OpenIdOAuth2Strategy = Strategy; // Example using Google OpenID profile.passport;
Authenticate Requests
Use passport.authenticate()
, specifying the strategy name, or 'openid-oauth20'
, to
authenticate requests.
For example, as route middleware in an Express application:
app; app;
License
Copyright (c) 2019 Christophe Querton <https://kertof.com/>