You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- See [type definition](https://github.com/panva/node-openid-client/blob/main/types/index.d.ts) of `openid-client`.
111
+
- See [`ClientMetadata`type definition](https://github.com/panva/node-openid-client/blob/main/types/index.d.ts) of `openid-client`.
112
112
- See [Client Metadata](https://openid.net/specs/openid-connect-registration-1_0.html#ClientMetadata) section in the `OpenID Connect Dynamic Client Registration 1.0`.
113
113
-`AuthorizationParameters`
114
-
- See [type definition](https://github.com/panva/node-openid-client/blob/main/types/index.d.ts) of `openid-client`.
114
+
- See [`AuthorizationParameters`type definition](https://github.com/panva/node-openid-client/blob/main/types/index.d.ts) of `openid-client`.
115
115
- See [Authentication Request](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest) section in the `OpenID Connect Core 1.0`.
116
116
117
+
## Endpoints
118
+
119
+
- ElysiaJS plugin metadata
120
+
- name: `elysia-openid-client-endpoints`
121
+
-[seed](https://elysiajs.com/essential/plugin#plugin-deduplication): `settings.pluginSeed` or else `issuerUrl`
122
+
- Ref: [openid-client API Documentation - Client](https://github.com/panva/node-openid-client/blob/main/docs/README.md#client)
123
+
124
+
### Details
125
+
126
+
- Login (GET: `/auth/login` )
127
+
- Calls `client.authorizationUrl` of openid-client.
128
+
- Redirect to authorization endpoint of the OP.
129
+
- Callback (GET: `/auth/callback` )
130
+
- Calls `client.callbackParams` and `client.callback` of openid-client.
131
+
- Redirect from the OP and redirect to the login completed page.
132
+
- Logout (GET: `/auth/logout` )
133
+
- Calls `client.endSessionUrl` of openid-client.
134
+
- Redirect to logout (end session) endpoint of the OP.
- Calls `client.requestResource` of openid-client.
146
+
- Through the response from the resource provider.
147
+
- Revoke (ALL: `/auth/revoke` )
148
+
- Calls `client.revoke` of openid-client.
149
+
- Return `204`
150
+
- Status (ALL: `/auth/status` )
151
+
- Fetches session status from internal database.
152
+
- Does not call any endpoint of the OP.
153
+
- Claims (ALL: `/auth/claims` )
154
+
- Fetches ID Token Claims from internal database.
155
+
- Does not call any endpoint of the OP.
156
+
157
+
## Hook
158
+
159
+
Determine the validity of the session in `onBeforeHandle`, and return `sessionStatus` and `sessionClaims` from the [`resolve` hook](https://elysiajs.com/life-cycle/before-handle.html#resolve).
- Ref: [`IdTokenClaims` type definition](https://github.com/panva/node-openid-client/blob/main/types/index.d.ts) of `openid-client`.
166
+
- Ref: [Claims](https://openid.net/specs/openid-connect-core-1_0.html#IDToken) and [IDToken](https://openid.net/specs/openid-connect-core-1_0.html#IDToken) section in the `OpenID Connect Core 1.0`.
167
+
- If the session is invalid:
168
+
- Redirect to `loginRedirectUrl`.
169
+
- If `disableRedirect` is `true`, both `sessionStatus` and `sessionClaims` will be `null`.
170
+
- ElysiaJS plugin metadata
171
+
- name: `elysia-openid-client-auth-hook`
172
+
-[seed](https://elysiajs.com/essential/plugin#plugin-deduplication): `settings.pluginSeed` or else `issuerUrl`
- Calls `client.requestResource` of openid-client.
325
-
- Through the response from the resource provider.
326
-
- Revoke (ALL: `/auth/revoke` )
327
-
- Calls `client.revoke` of openid-client.
328
-
- Return `204`
329
-
- Status (ALL: `/auth/status` )
330
-
- Fetches session status from internal database.
331
-
- Does not call any endpoint of the OP.
332
-
- Claims (ALL: `/auth/claims` )
333
-
- Fetches ID Token Claims from internal database.
334
-
- Does not call any endpoint of the OP.
335
-
336
-
## Hook
337
-
338
-
Determine the validity of the session in `onBeforeHandle`, and return `sessionStatus` and `sessionClaims` from the [`resolve` hook](https://elysiajs.com/life-cycle/before-handle.html#resolve).
339
-
340
-
- If the session is valid:
341
-
-`sessionStatus`: Session status
342
-
-`sessionClaims`: ID Token Claims
343
-
- If the session is invalid:
344
-
- Redirect to `loginRedirectUrl`.
345
-
- If `disableRedirect` is `false`, both `sessionStatus` and `sessionClaims` will be `null`.
346
-
- ElysiaJS plugin metadata
347
-
- name: `elysia-openid-client-auth-hook`
348
-
-[seed](https://elysiajs.com/essential/plugin#plugin-deduplication): `settings.pluginSeed` or else `issuerUrl`
If you are using GitHub Copilot to generate suggested code, you must set the `Suggestions matching public code` option to `Block`. If you are using a similar service with a similar option, you must do the same.
0 commit comments