passport-crcsi-openidconnect
CRCSI OpenID Connect authentication strategy for Passport.
Last updated 2 years ago by riyasdeen .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install passport-crcsi-openidconnect 
SYNC missed versions from official npm registry.

CRCSI Accounts passport strategy

Development based on passport-google-openidconnect package.

This module lets you authenticate using CRCSI Accounts OpenID Connect in your Node.js applications.

Install

$ npm install passport-crcsi-openidconnect

Configure Strategy

The CRCSI OpenIDConnect authentication strategy authenticates users using a CRCSI account and OpenIDConnect tokens. The strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a client ID, client secret, and callback URL.

var StrategyCRCSI = require('passport-crcsi-openidconnect').Strategy;
passport.use(new StrategyCRCSI({
    endpointURL: "http://accounts.crcsi.com.au"
    clientID: CRCSI_CLIENT_ID,
    clientSecret: CRCSI_CLIENT_SECRET,
    callbackURL: "http://localhost:3000/auth/callback"
  },
  function(iss, sub, profile, accessToken, refreshToken, done) {
    return done(null, profile);
  }
));

Options

  • endpointURL (Optional) - CRCSI accounts endpoint, Defaults to http://accounts.crcsi.com.au
  • clientID (Required) - Client ID for the application. This is required, you can get a clientID when a product is created in CRCSI Accounts
  • clientSecret (Required) - Client Secret for the application. This is required, you can get a clientSecret when a product is created in CRCSI Accounts
  • callbackURL (Required) - Callback endpoint to pass the authentication information
  • scope (Optional) - Claim scopes requested by the application. Should be an array of scopes or space seperated strings. Defaults to ['profile']
    • profile - Provides name, first_name, last_name, picture, jobtitle, jobrole, organization
    • email - Provides user's email details
    • phone - Provides user's phone contact details
    • address - Provides user's address details
    • subscription - Provides user's subscription details to the application

Authenticate Requests

Use passport.authenticate(), specifying the 'crcsi-openidconnect' strategy, to authenticate requests.

An example application is available provide repository details:

app.get('/auth/crcsi',
  passport.authenticate('crcsi-openidconnect'));

app.get('/auth/crcsi/callback', 
  passport.authenticate('crcsi-openidconnect', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

Current Tags

  • 0.0.14                                ...           latest (2 years ago)

9 Versions

  • 0.0.14                                ...           2 years ago
  • 0.0.13                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           3 years ago
  • 0.0.8                                ...           3 years ago
  • 0.0.7                                ...           3 years ago
  • 0.0.6                                ...           3 years ago
  • 0.0.5                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (4)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |