Package Exports
- passport-ibmsso-openidconnect
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (passport-ibmsso-openidconnect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
passport-ibmsso-openidconnect
This module provides the passport strategy for authenticating with IBMid and w3id OpenID Connect.
Install
$ npm install passport-ibmsso-openidconnect
Usage
Example
- Without discovery endpoint example:
import Strategy from 'passport-ibmsso-openidconnect';
import fs from 'fs';
const strategy = new Strategy({
authorizationURL: <Authorization Endpoint>,
tokenURL: <Token EndPoint>,
clientID: <Client ID>,
scope: 'openid',
response_type: 'code',
clientSecret: <Client Secret>,
callbackURL: <Redirect URI>,
skipUserProfile: true,
issuer: <Issuer>,
certs: [
fs.readFileSync(<Cert1 Path>),
fs.readFileSync(<Cert2 Path>),
...
]
}, (iss, sub, profile, accessToken, refreshToken, params, done) => {
process.nextTick(() => {
profile._json.accessToken = accessToken;
profile._json.refreshToken = refreshToken;
return done(null, profile);
});
});
strategy.init()
.then(() => {
passport.use('ibmopenidconnect', strategy.openid);
});
- With discovery endpoint example:
import Strategy from 'passport-ibmsso-openidconnect';
import fs from 'fs';
const strategy = new Strategy({
autoDiscovery: true,
clientID: <Client ID>,
scope: 'openid',
response_type: 'code',
clientSecret: <Client Secret>,
callbackURL: <Redirect URI>,
skipUserProfile: false,
issuer: <Issuer>
}, (iss, sub, profile, accessToken, refreshToken, params, done) => {
process.nextTick(() => {
profile._json.accessToken = accessToken;
profile._json.refreshToken = refreshToken;
return done(null, profile);
});
});
strategy.init()
.then(() => {
passport.use('ibmopenidconnect', strategy.openid);
});