userin-core ·
UserIn core component to build an OAuth 2.0 OpenID Connect web API that supports integration with the most popular Federated Identity Providers (e.g., Google, Facebook, GitHub)
npm i userin-core
Table of contents
Create a new UserIn Strategy
const Strategy = { super thisname = 'yourcustomstrategy' this { /* Implement your logic here */ } this { /* Implement your logic here */ } this { /* Implement your logic here */ } this { /* Implement your logic here */ } this { /* Implement your logic here */ } this { /* Implement your logic here */ } }
To facilitate custom implementation, we've added a template here.
Utilities
token.id_token.addDateClaims(claims: Object[, expiryInSeconds: Number])
expiryInSeconds
is optional. Its default value is 3600
seconds.
const token = const claims = iss:'https://example.com' first_name:'Nic' last_name:'Dao' console // Prints:// {// iss:'https://example.com', // first_name:'Nic', // last_name:'Dao',// iat: 1600148277,// exp: 1600151877// }