OidcClient
OpenID Connect client plugin for ElysiaJS
- Usage:
const client = await BaseOidcClient.factory(options);
const endpoints = client.createEndpoints();
const hook = client.createAuthHook();
Extends
Properties
authHookSettings
authHookSettings:
OIDCClientAuthHookSettings
Cookie settings
Inherited from
BaseOidcClient
.authHookSettings
Defined in
authParams
authParams:
AuthorizationParameters
OIDC Authorization parameters
Inherited from
Defined in
baseUrl
baseUrl:
string
Client Base URL
Inherited from
Defined in
client
client:
BaseClient
OIDC Client (Initialize at factory())
Inherited from
Defined in
clientMetadata
clientMetadata:
ClientMetadata
OIDC Client metadata
Inherited from
Defined in
clients
clients:
Record
<string
,BaseClient
>
OIDC Clients for multiple issuers (Initialize at factory())
Inherited from
Defined in
cookieSettings
cookieSettings:
OIDCClientCookieSettings
Cookie settings
Inherited from
Defined in
createSession()
createSession: () =>
Promise
<[string
,string
]>
Create session and insert to DB
Returns
Promise
<[string
, string
]>
[sessionId, authorizationUrl]
Defined in
fetchSession()
fetchSession: (
sessionId
) =>Promise
<null
|OIDCClientActiveSession
>
Find and validate session from cookie and DB
Parameters
• sessionId: undefined
| string
Sessison ID
Returns
Promise
<null
| OIDCClientActiveSession
>
Session data or false
Defined in
initialized
initialized:
boolean
=false
Initialized
Inherited from
Defined in
introspect()
introspect: (
args
) =>Promise
<null
|IntrospectionResponse
>
Use introspect endpoint directly
Parameters
• args: OIDCClientMethodArgs
Returns
Promise
<null
| IntrospectionResponse
>
Defined in
issuer
issuer:
Issuer
<BaseClient
>
OIDC Issuer (Initialize at factory())
Inherited from
Defined in
issuerUrl
issuerUrl:
string
OIDC IdP URL
Inherited from
Defined in
logger
logger:
undefined
|OIDCClientLogger
Logger
Inherited from
Defined in
refresh()
refresh: (
args
) =>Promise
<null
|IdTokenClaims
>
Use refresh endpoint directly
Parameters
• args: OIDCClientMethodArgs
Returns
Promise
<null
| IdTokenClaims
>
Defined in
resource()
resource: (
args
) =>Promise
<null
|object
&IncomingMessage
>
Use resource endpoint directly
Parameters
• args: OIDCClientMethodArgs
& object
Returns
Promise
<null
| object
& IncomingMessage
>
Defined in
revoke()
revoke: (
args
) =>Promise
<undefined
|null
>
Use revoke endpoint directly
Parameters
• args: OIDCClientMethodArgs
Returns
Promise
<undefined
| null
>
Defined in
sessions
sessions:
OIDCClientDataAdapter
Plugin database
Inherited from
Defined in
settings
settings:
OIDCClientSettings
Plugin settings
Inherited from
Defined in
updateSession()
updateSession: (
sessionId
,tokenSet
) =>Promise
<null
|OIDCClientActiveSession
>
Update session in DB
Parameters
• sessionId: string
Session ID
• tokenSet: TokenSet
TokenSet
Returns
Promise
<null
| OIDCClientActiveSession
>
Defined in
userinfo()
userinfo: (
args
) =>Promise
<null
|UserinfoResponse
<UnknownObject
,UnknownObject
>>
Use userinfo endpoint directly
Parameters
• args: OIDCClientMethodArgs
Returns
Promise
<null
| UserinfoResponse
<UnknownObject
, UnknownObject
>>
Defined in
Accessors
authHook
get
authHook():Elysia
<""
,false
,object
,object
,object
,object
,object
,object
>
Get onBeforeHandle for restricted endpoints
Returns
Elysia
<""
, false
, object
, object
, object
, object
, object
, object
>
ElysiaJS Plugin
Defined in
cookieTypeBox
get
cookieTypeBox():TObject
<object
>
Cookie definition for ElysiaJS
Returns
TObject
<object
>
Defined in
endpoints
get
endpoints():Elysia
<""
,false
,object
,object
,object
,object
,object
,object
>
OpenID Connect client plugin for ElysiaJS
Returns
Elysia
<""
, false
, object
, object
, object
, object
, object
, object
>
ElysiaJS Plugin
Defined in
paths
get
paths():OIDCClientPaths
Get list of endpoint paths
Returns
Record<string, string>
Inherited from
Defined in
src/core/BaseOidcClient.ts:134
Methods
registerClient()
registerClient(
client
):void
Add another client to client list
- For multiple issuers
Parameters
• client: BaseClient
Client
Returns
void
Inherited from
Defined in
src/core/BaseOidcClient.ts:125
factory()
static
factory(options
):Promise
<OidcClient
>
Create OidcClient instance
Parameters
• options: OIDCClientOptions
Returns
Promise
<OidcClient
>
OidcClient instance