Hapi-OIDC
OpenID-Connect authentication plugin for hapi.
Configuration
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 process
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 endpoint
When 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]
Example
const Hapi = ;const uuid4 = ;const OIDC = ; const routes = ; const server = Hapi; const init = async { await server; serverauth; server; await serverstart; server;}; ; moduleexports = server;