1.0.12 • Published 5 years ago

signicat-oidc-client v1.0.12

Weekly downloads
3
License
MIT
Repository
-
Last release
5 years ago

Signicat OpenID Connect Provider

Signicat OpenID Connect Provider is a library to simplify implementation of it's SDK in NodeJS projects.

npm version

Installation

If you are using yarn package manager.

yarn install signicat-oidc-client

If you are using npm package manager.

npm i signicat-oidc-client

Usage

Fully working RunKIT example with express

Try signicat-oidc-client on RunKit

Redirect to our Auth endpoint

const signicat = require("signicat-oidc-client");

// Create an instance of SDK client
let client = signicat.Signicat.init('DFvfZ4bVE4tmoxjxjKm7L4uSOftBJYPL', 'hL_mqdzkDR7F-BrSUhPCfO8O1f02ZM1BLfFSF77LkcQZ4eEI5wH-xO4UlPxMPlfJ');

// Create params (nonce and state will be generated by SDK, you can allso pass them as arguments)
let params = signicat.Signicat.generateParams('https://your-callback-url/');

// Get redirect URI and redirect to this page
let redirectUrl = await client.getAuthorizationUrl(params);

Implementing callback return response with express

const signicat = require("signicat-oidc-client");

const { nonce, state } = req.session;
delete req.session.nonce;
delete req.session.state;

// Create an instance of SDK client
let client = signicat.Signicat.init('DFvfZ4bVE4tmoxjxjKm7L4uSOftBJYPL', 'hL_mqdzkDR7F-BrSUhPCfO8O1f02ZM1BLfFSF77LkcQZ4eEI5wH-xO4UlPxMPlfJ');

// Parsing callback params
let callbackParams = await client.getCallbackParams(req);

// Saving response to our session storage
req.session.user = await client.getAuthorizationCallback(CALLBACK_URL, callbackParams, {nonce, state, response_type: 'token id_token'});

// Now you can redirect to your 

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago