Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
OpenID-Connect authentication plugin for hapi.
This plugin needs some configuration to discover and connect to the OIDC server:
discoverUrl
: The discovery URL of your OIDC serverclientId
: Client ID given by your OIDC serverclientSecret
: Client secret given by your OIDC servercallbackUrl
: The full URL that the server will call after the authorization processcookie
]: Name of the cookie that will held the authentication. Defaults to hapi-oidc
Alternatively, you can manually setup your OIDC client by replacing the discover URL by:
issuer
: URL of the issuerauthorization
: Authorization endpointtoken
: Token generation endpointuserinfo
: User infos endpointjwks
: JWKS endpointWhen registering the oidc
scheme, you'll need to configure the cookie settings if defaults do not suits you:
password
=uuid4(),path
='/']ttl
= 3600 * 1000]encoding
='iron']isSecure
=true],clearInvalid
=true]const Hapi = require('hapi');
const uuid4 = require('uuid/v4');
const OIDC = require('hapi-oidc');
const routes = require('./routes');
const server = Hapi.server({
port: 3000,
});
const init = async () => {
await server.register([
{
plugin: OIDC,
options: {
discoverUrl: 'https://oidc-server.com/oauth2/default',
clientId: 'XXXXXXXXXXXXXXX',
clientSecret: 'XXXXXXXXXXXXXXXXXXXXXX',
callbackUrl: 'https://my-server:3000/login_callback',
},
}
]);
server.auth.strategy('oidc', 'oidc', {
password: uuid4(),
});
server.route(routes);
await server.start();
server.log(['info'], `Server running at: ${server.info.uri}`);
};
init();
module.exports = server;
[2.0.1] - 2019-12-10
FAQs
Hapi authentication strategy for OpenID Connect
The npm package hapi-oidc receives a total of 0 weekly downloads. As such, hapi-oidc popularity was classified as not popular.
We found that hapi-oidc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.