コンテンツにスキップ

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

src/core/BaseOidcClient.ts:42


authParams

authParams: AuthorizationParameters

OIDC Authorization parameters

Inherited from

BaseOidcClient.authParams

Defined in

src/core/BaseOidcClient.ts:36


baseUrl

baseUrl: string

Client Base URL

Inherited from

BaseOidcClient.baseUrl

Defined in

src/core/BaseOidcClient.ts:30


client

client: BaseClient

OIDC Client (Initialize at factory())

Inherited from

BaseOidcClient.client

Defined in

src/core/BaseOidcClient.ts:46


clientMetadata

clientMetadata: ClientMetadata

OIDC Client metadata

Inherited from

BaseOidcClient.clientMetadata

Defined in

src/core/BaseOidcClient.ts:34


clients

clients: Record<string, BaseClient>

OIDC Clients for multiple issuers (Initialize at factory())

Inherited from

BaseOidcClient.clients

Defined in

src/core/BaseOidcClient.ts:48


cookieSettings

cookieSettings: OIDCClientCookieSettings

Cookie settings

Inherited from

BaseOidcClient.cookieSettings

Defined in

src/core/BaseOidcClient.ts:40


createSession()

createSession: () => Promise<[string, string]>

Create session and insert to DB

Returns

Promise<[string, string]>

[sessionId, authorizationUrl]

Defined in

src/core/OidcClient.ts:89


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

src/core/OidcClient.ts:108


initialized

initialized: boolean = false

Initialized

Inherited from

BaseOidcClient.initialized

Defined in

src/core/BaseOidcClient.ts:54


introspect()

introspect: (args) => Promise<null | IntrospectionResponse>

Use introspect endpoint directly

Parameters

args: OIDCClientMethodArgs

Returns

Promise<null | IntrospectionResponse>

Defined in

src/core/OidcClient.ts:75


issuer

issuer: Issuer<BaseClient>

OIDC Issuer (Initialize at factory())

Inherited from

BaseOidcClient.issuer

Defined in

src/core/BaseOidcClient.ts:44


issuerUrl

issuerUrl: string

OIDC IdP URL

Inherited from

BaseOidcClient.issuerUrl

Defined in

src/core/BaseOidcClient.ts:32


logger

logger: undefined | OIDCClientLogger

Logger

Inherited from

BaseOidcClient.logger

Defined in

src/core/BaseOidcClient.ts:52


refresh()

refresh: (args) => Promise<null | IdTokenClaims>

Use refresh endpoint directly

Parameters

args: OIDCClientMethodArgs

Returns

Promise<null | IdTokenClaims>

Defined in

src/core/OidcClient.ts:64


resource()

resource: (args) => Promise<null | object & IncomingMessage>

Use resource endpoint directly

Parameters

args: OIDCClientMethodArgs & object

Returns

Promise<null | object & IncomingMessage>

Defined in

src/core/OidcClient.ts:80


revoke()

revoke: (args) => Promise<undefined | null>

Use revoke endpoint directly

Parameters

args: OIDCClientMethodArgs

Returns

Promise<undefined | null>

Defined in

src/core/OidcClient.ts:67


sessions

sessions: OIDCClientDataAdapter

Plugin database

Inherited from

BaseOidcClient.sessions

Defined in

src/core/BaseOidcClient.ts:50


settings

settings: OIDCClientSettings

Plugin settings

Inherited from

BaseOidcClient.settings

Defined in

src/core/BaseOidcClient.ts:38


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

src/core/OidcClient.ts:97


userinfo()

userinfo: (args) => Promise<null | UserinfoResponse<UnknownObject, UnknownObject>>

Use userinfo endpoint directly

Parameters

args: OIDCClientMethodArgs

Returns

Promise<null | UserinfoResponse<UnknownObject, UnknownObject>>

Defined in

src/core/OidcClient.ts:70

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

src/core/OidcClient.ts:134


cookieTypeBox

get cookieTypeBox(): TObject<object>

Cookie definition for ElysiaJS

Returns

TObject<object>

Defined in

src/core/OidcClient.ts:123


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

src/core/OidcClient.ts:143


paths

get paths(): OIDCClientPaths

Get list of endpoint paths

Returns

OIDCClientPaths

Record<string, string>

Inherited from

BaseOidcClient.paths

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

BaseOidcClient.registerClient

Defined in

src/core/BaseOidcClient.ts:125


factory()

static factory(options): Promise<OidcClient>

Create OidcClient instance

Parameters

options: OIDCClientOptions

Returns

Promise<OidcClient>

OidcClient instance

Static

Overrides

BaseOidcClient.factory

Defined in

src/core/OidcClient.ts:57