openid-client 5.6.5 β 6.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +170 -267
- package/build/index.d.ts +1884 -0
- package/build/index.js +893 -0
- package/build/index.js.map +1 -0
- package/package.json +78 -75
- package/lib/client.js +0 -1849
- package/lib/device_flow_handle.js +0 -125
- package/lib/errors.js +0 -55
- package/lib/helpers/assert.js +0 -24
- package/lib/helpers/base64url.js +0 -13
- package/lib/helpers/client.js +0 -211
- package/lib/helpers/consts.js +0 -7
- package/lib/helpers/decode_jwt.js +0 -27
- package/lib/helpers/deep_clone.js +0 -1
- package/lib/helpers/defaults.js +0 -27
- package/lib/helpers/generators.js +0 -14
- package/lib/helpers/is_key_object.js +0 -4
- package/lib/helpers/is_plain_object.js +0 -1
- package/lib/helpers/issuer.js +0 -111
- package/lib/helpers/keystore.js +0 -298
- package/lib/helpers/merge.js +0 -24
- package/lib/helpers/pick.js +0 -9
- package/lib/helpers/process_response.js +0 -71
- package/lib/helpers/request.js +0 -200
- package/lib/helpers/unix_timestamp.js +0 -1
- package/lib/helpers/weak_cache.js +0 -1
- package/lib/helpers/webfinger_normalize.js +0 -71
- package/lib/helpers/www_authenticate_parser.js +0 -14
- package/lib/index.js +0 -23
- package/lib/index.mjs +0 -9
- package/lib/issuer.js +0 -191
- package/lib/issuer_registry.js +0 -3
- package/lib/passport_strategy.js +0 -205
- package/lib/token_set.js +0 -35
- package/types/index.d.ts +0 -622
package/README.md
CHANGED
|
@@ -1,323 +1,226 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
openid-client is a server side [OpenID][openid-connect] Relying Party (RP, Client) implementation for
|
|
4
|
-
Node.js runtime, supports [passport][passport-url].
|
|
5
|
-
|
|
6
|
-
## Implemented specs & features
|
|
7
|
-
|
|
8
|
-
The following client/RP features from OpenID Connect/OAuth2.0 specifications are implemented by
|
|
9
|
-
openid-client.
|
|
10
|
-
|
|
11
|
-
- [OpenID Connect Core 1.0][feature-core]
|
|
12
|
-
- Authorization Callback
|
|
13
|
-
- Authorization Code Flow
|
|
14
|
-
- Implicit Flow
|
|
15
|
-
- Hybrid Flow
|
|
16
|
-
- UserInfo Request
|
|
17
|
-
- Offline Access / Refresh Token Grant
|
|
18
|
-
- Client Credentials Grant
|
|
19
|
-
- Client Authentication
|
|
20
|
-
- none
|
|
21
|
-
- client_secret_basic
|
|
22
|
-
- client_secret_post
|
|
23
|
-
- client_secret_jwt
|
|
24
|
-
- private_key_jwt
|
|
25
|
-
- Consuming Self-Issued OpenID Provider ID Token response
|
|
26
|
-
- [OpenID Connect Discovery 1.0][feature-discovery]
|
|
27
|
-
- Discovery of OpenID Provider (Issuer) Metadata
|
|
28
|
-
- Discovery of OpenID Provider (Issuer) Metadata via user provided inputs (via [webfinger][documentation-webfinger])
|
|
29
|
-
- [OpenID Connect Dynamic Client Registration 1.0][feature-registration]
|
|
30
|
-
- Dynamic Client Registration request
|
|
31
|
-
- Client initialization via registration client uri
|
|
32
|
-
- [RFC7009 - OAuth 2.0 Token revocation][feature-revocation]
|
|
33
|
-
- Client Authenticated request to token revocation
|
|
34
|
-
- [RFC7662 - OAuth 2.0 Token introspection][feature-introspection]
|
|
35
|
-
- Client Authenticated request to token introspection
|
|
36
|
-
- [RFC8628 - OAuth 2.0 Device Authorization Grant (Device Flow)][feature-device-flow]
|
|
37
|
-
- [RFC8705 - OAuth 2.0 Mutual TLS Client Authentication and Certificate-Bound Access Tokens][feature-mtls]
|
|
38
|
-
- Mutual TLS Client Certificate-Bound Access Tokens
|
|
39
|
-
- Metadata for Mutual TLS Endpoint Aliases
|
|
40
|
-
- Client Authentication
|
|
41
|
-
- tls_client_auth
|
|
42
|
-
- self_signed_tls_client_auth
|
|
43
|
-
- [RFC9101 - OAuth 2.0 JWT-Secured Authorization Request (JAR)][feature-jar]
|
|
44
|
-
- [RFC9126 - OAuth 2.0 Pushed Authorization Requests (PAR)][feature-par]
|
|
45
|
-
- [RFC9449 - OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP)][feature-dpop]
|
|
46
|
-
- [OpenID Connect RP-Initiated Logout 1.0][feature-rp-logout]
|
|
47
|
-
- [Financial-grade API Security Profile 1.0 - Part 2: Advanced (FAPI)][feature-fapi]
|
|
48
|
-
- [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)][feature-jarm]
|
|
49
|
-
- [OAuth 2.0 Authorization Server Issuer Identification][feature-iss]
|
|
50
|
-
|
|
51
|
-
Updates to draft specifications are released as MINOR library versions,
|
|
52
|
-
if you utilize these specification implementations consider using the tilde `~` operator in your
|
|
53
|
-
package.json since breaking changes may be introduced as part of these version updates.
|
|
54
|
-
|
|
55
|
-
## Certification
|
|
56
|
-
[<img width="184" height="96" align="right" src="https://cdn.jsdelivr.net/gh/panva/node-openid-client@38cf016b0837e6d4116de3780b28d222d5780bc9/OpenID_Certified.png" alt="OpenID Certification">][openid-certified-link]
|
|
57
|
-
Filip Skokan has [certified][openid-certified-link] that [openid-client][npm-url]
|
|
58
|
-
conforms to the following profiles of the OpenID Connectβ’ protocol
|
|
59
|
-
|
|
60
|
-
- Basic, Implicit, Hybrid, Config, Dynamic, and Form Post RP
|
|
61
|
-
- FAPI 1.0 Advanced RP
|
|
1
|
+
# High-Level OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
|
|
62
2
|
|
|
63
|
-
|
|
3
|
+
TODO
|
|
64
4
|
|
|
65
|
-
|
|
5
|
+
## Features
|
|
66
6
|
|
|
67
|
-
|
|
7
|
+
The following features are currently in scope and implemented in this software:
|
|
68
8
|
|
|
69
|
-
|
|
9
|
+
- Authorization Server Metadata discovery
|
|
10
|
+
- Authorization Code Flow (profiled under OpenID Connect 1.0, OAuth 2.0, OAuth 2.1, FAPI 1.0 Advanced, and FAPI 2.0)
|
|
11
|
+
- Refresh Token, Device Authorization, and Client Credentials Grants
|
|
12
|
+
- Demonstrating Proof-of-Possession at the Application Layer (DPoP)
|
|
13
|
+
- Token Introspection and Revocation
|
|
14
|
+
- Pushed Authorization Requests (PAR)
|
|
15
|
+
- UserInfo and Protected Resource Requests
|
|
16
|
+
- Authorization Server Issuer Identification
|
|
17
|
+
- JWT Secured Introspection, Response Mode (JARM), Authorization Request (JAR), and UserInfo
|
|
70
18
|
|
|
19
|
+
## Sponsor
|
|
71
20
|
|
|
72
|
-
|
|
21
|
+
<picture>
|
|
22
|
+
<source media="(prefers-color-scheme: dark)" srcset="./sponsor/Auth0byOkta_dark.png">
|
|
23
|
+
<source media="(prefers-color-scheme: light)" srcset="./sponsor/Auth0byOkta_light.png">
|
|
24
|
+
<img height="65" align="left" alt="Auth0 by Okta" src="./sponsor/Auth0byOkta_light.png">
|
|
25
|
+
</picture>
|
|
73
26
|
|
|
74
|
-
|
|
75
|
-
OpenID Connect Authorization Server responses or wrappers around requests to its endpoints. Aside
|
|
76
|
-
from a generic OpenID Connect [passport][passport-url] strategy it does not expose any framework
|
|
77
|
-
specific middlewares. Those can however be built using the exposed API, one such example is [express-openid-connect][]
|
|
27
|
+
If you want to quickly add authentication to JavaScript apps, feel free to check out Auth0's JavaScript SDK and free plan. [Create an Auth0 account; it's free!][sponsor-auth0]<br><br>
|
|
78
28
|
|
|
79
|
-
|
|
80
|
-
- [Issuer][documentation-issuer]
|
|
81
|
-
- [Client][documentation-client]
|
|
82
|
-
- [Customizing][documentation-customizing]
|
|
83
|
-
- [TokenSet][documentation-tokenset]
|
|
84
|
-
- [Strategy][documentation-strategy]
|
|
85
|
-
- [generators][documentation-generators]
|
|
86
|
-
- [errors][documentation-errors]
|
|
29
|
+
## [Certification](https://openid.net/certification/faq/)
|
|
87
30
|
|
|
88
|
-
|
|
31
|
+
[<img width="96" height="50" align="right" src="https://user-images.githubusercontent.com/241506/166977513-7cd710a9-7f60-4944-aebe-a658e9f36375.png" alt="OpenID Certification">](#certification)
|
|
89
32
|
|
|
90
|
-
|
|
33
|
+
[Filip Skokan](https://github.com/panva) has [certified](https://openid.net/certification) that [this software](https://github.com/panva/openid-client) conforms to the Basic, FAPI 1.0, and FAPI 2.0 Relying Party Conformance Profiles of the OpenID Connectβ’ protocol.
|
|
91
34
|
|
|
92
|
-
|
|
93
|
-
npm install openid-client
|
|
94
|
-
```
|
|
35
|
+
## [π Help the project](https://github.com/sponsors/panva)
|
|
95
36
|
|
|
96
|
-
|
|
97
|
-
I recommend [panva/oauth4webapi][oauth4webapi], or a derivate thereof, if you're
|
|
98
|
-
looking for a similarly compliant and certified client software that's not dependent
|
|
99
|
-
on the Node.js runtime builtins.
|
|
37
|
+
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).
|
|
100
38
|
|
|
101
39
|
## Quick start
|
|
102
40
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
41
|
+
```ts
|
|
42
|
+
import * as client from 'openid-client'
|
|
43
|
+
|
|
44
|
+
let server!: URL
|
|
45
|
+
let clientId!: string
|
|
46
|
+
let clientSecret!: string
|
|
47
|
+
let config: client.Configuration = await client.discovery(
|
|
48
|
+
server,
|
|
49
|
+
clientId,
|
|
50
|
+
clientSecret,
|
|
51
|
+
)
|
|
109
52
|
```
|
|
110
53
|
|
|
111
54
|
### Authorization Code Flow
|
|
112
55
|
|
|
113
56
|
Authorization Code flow is for obtaining Access Tokens (and optionally Refresh Tokens) to use with
|
|
114
|
-
third party APIs
|
|
115
|
-
PKCE instead of `state` parameter for CSRF protection.
|
|
116
|
-
|
|
117
|
-
Create a Client instance for that issuer's authorization server intended for Authorization Code
|
|
118
|
-
flow.
|
|
119
|
-
|
|
120
|
-
**See the [documentation][] for full API details.**
|
|
121
|
-
|
|
122
|
-
```js
|
|
123
|
-
const client = new googleIssuer.Client({
|
|
124
|
-
client_id: 'zELcpfANLqY7Oqas',
|
|
125
|
-
client_secret: 'TQV5U29k1gHibH5bx1layBo0OSAvAbRT3UYW3EWrSYBB5swxjVfWUa1BS8lqzxG/0v9wruMcrGadany3',
|
|
126
|
-
redirect_uris: ['http://localhost:3000/cb'],
|
|
127
|
-
response_types: ['code'],
|
|
128
|
-
// id_token_signed_response_alg (default "RS256")
|
|
129
|
-
// token_endpoint_auth_method (default "client_secret_basic")
|
|
130
|
-
}); // => Client
|
|
131
|
-
```
|
|
57
|
+
third party APIs.
|
|
132
58
|
|
|
133
|
-
When you want to have your end-users authorize you need to send them to the
|
|
134
|
-
`authorization_endpoint`. Consult the web framework of your choice on how to redirect but here's how
|
|
59
|
+
When you want to have your end-users authorize or authenticate you need to send them to the authorization server's `authorization_endpoint`. Consult the web framework of your choice on how to redirect but here's how
|
|
135
60
|
to get the authorization endpoint's URL with parameters already encoded in the query to redirect
|
|
136
61
|
to.
|
|
137
62
|
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
63
|
+
```ts
|
|
64
|
+
/**
|
|
65
|
+
* Value used in the authorization request as redirect_uri pre-registered at the
|
|
66
|
+
* Authorization Server.
|
|
67
|
+
*/
|
|
68
|
+
let redirect_uri!: string
|
|
69
|
+
let scope!: string
|
|
70
|
+
/**
|
|
71
|
+
* The following MUST be generated for every redirect to the
|
|
72
|
+
* authorization_endpoint. You must store the code_verifier and state in the
|
|
73
|
+
* end-user session such that it can be recovered as the user gets redirected
|
|
74
|
+
* from the authorization server back to your application.
|
|
75
|
+
*/
|
|
76
|
+
let code_verifier: string = client.randomPKCECodeVerifier()
|
|
77
|
+
let code_challenge: string =
|
|
78
|
+
await client.calculatePKCECodeChallenge(code_verifier)
|
|
79
|
+
let state!: string
|
|
80
|
+
|
|
81
|
+
let parameters: Record<string, string> = {
|
|
82
|
+
redirect_uri,
|
|
83
|
+
scope,
|
|
149
84
|
code_challenge,
|
|
150
85
|
code_challenge_method: 'S256',
|
|
151
|
-
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (
|
|
89
|
+
config.serverMetadata().code_challenge_methods_supported?.includes('S256') !==
|
|
90
|
+
true
|
|
91
|
+
) {
|
|
92
|
+
/**
|
|
93
|
+
* We cannot be sure the server supports PKCE so we're going to use state too.
|
|
94
|
+
* Use of PKCE is backwards compatible even if the AS doesn't support it which
|
|
95
|
+
* is why we're using it regardless.
|
|
96
|
+
*/
|
|
97
|
+
state = client.randomState()
|
|
98
|
+
parameters.state = state
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
let redirectTo: URL = client.buildAuthorizationUrl(config, parameters)
|
|
102
|
+
|
|
103
|
+
// now redirect the user to redirectTo.href
|
|
104
|
+
console.log('redirecting to', redirectTo.href)
|
|
152
105
|
```
|
|
153
106
|
|
|
154
107
|
When end-users are redirected back to your `redirect_uri` your application consumes the callback and
|
|
155
108
|
passes in the `code_verifier` to include it in the authorization code grant token exchange.
|
|
156
|
-
```js
|
|
157
|
-
const params = client.callbackParams(req);
|
|
158
|
-
const tokenSet = await client.callback('https://client.example.com/callback', params, { code_verifier });
|
|
159
|
-
console.log('received and validated tokens %j', tokenSet);
|
|
160
|
-
console.log('validated ID Token claims %j', tokenSet.claims());
|
|
161
|
-
```
|
|
162
109
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const userinfo = await client.userinfo(access_token);
|
|
166
|
-
console.log('userinfo %j', userinfo);
|
|
167
|
-
```
|
|
110
|
+
```ts
|
|
111
|
+
let getCurrentUrl!: (...args: any) => URL
|
|
168
112
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
113
|
+
let tokens: client.TokenEndpointResponse = await client.authorizationCodeGrant(
|
|
114
|
+
config,
|
|
115
|
+
getCurrentUrl(),
|
|
116
|
+
{
|
|
117
|
+
pkceCodeVerifier: code_verifier,
|
|
118
|
+
expectedState: state,
|
|
119
|
+
},
|
|
120
|
+
)
|
|
175
121
|
|
|
176
|
-
|
|
122
|
+
console.log('Token Endpoint Response', tokens)
|
|
123
|
+
```
|
|
177
124
|
|
|
178
|
-
|
|
179
|
-
the only job you want done is authenticating the user and then relying on your own session mechanism
|
|
180
|
-
with no need for accessing any third party APIs with an Access Token from the Authorization Server.
|
|
125
|
+
You can then fetch a protected resource response
|
|
181
126
|
|
|
182
|
-
|
|
127
|
+
```ts
|
|
128
|
+
let protectedResourceResponse: Response = await client.fetchProtectedResource(
|
|
129
|
+
config,
|
|
130
|
+
tokens.access_token,
|
|
131
|
+
new URL('https://rs.example.com/api'),
|
|
132
|
+
'GET',
|
|
133
|
+
)
|
|
183
134
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
redirect_uris: ['http://localhost:3000/cb'],
|
|
189
|
-
response_types: ['id_token'],
|
|
190
|
-
// id_token_signed_response_alg (default "RS256")
|
|
191
|
-
}); // => Client
|
|
135
|
+
console.log(
|
|
136
|
+
'Protected Resource Response',
|
|
137
|
+
await protectedResourceResponse.json(),
|
|
138
|
+
)
|
|
192
139
|
```
|
|
193
140
|
|
|
194
|
-
|
|
195
|
-
`authorization_endpoint`. Consult the web framework of your choice on how to redirect but here's how
|
|
196
|
-
to get the authorization endpoint's URL with parameters already encoded in the query to redirect
|
|
197
|
-
to.
|
|
141
|
+
### Device Authorization Grant (Device Flow)
|
|
198
142
|
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
scope: 'openid email profile',
|
|
207
|
-
response_mode: 'form_post',
|
|
208
|
-
nonce,
|
|
209
|
-
});
|
|
143
|
+
```ts
|
|
144
|
+
let scope!: string
|
|
145
|
+
let response = await client.initiateDeviceAuthorization(config, { scope })
|
|
146
|
+
|
|
147
|
+
console.log('User Code:', response.user_code)
|
|
148
|
+
console.log('Verification URI:', response.verification_uri)
|
|
149
|
+
console.log('Verification URI (complete):', response.verification_uri_complete)
|
|
210
150
|
```
|
|
211
151
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
console.log('
|
|
220
|
-
console.log('validated ID Token claims %j', tokenSet.claims());
|
|
152
|
+
You will display the instructions to the end-user and have them directed at `verification_uri` or
|
|
153
|
+
`verification_uri_complete`, afterwards you can start polling for the Device Access Token Response.
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
let tokens: client.TokenEndpointResponse =
|
|
157
|
+
await client.pollDeviceAuthorizationGrant(config, response)
|
|
158
|
+
|
|
159
|
+
console.log('Token Endpoint Response', tokens)
|
|
221
160
|
```
|
|
222
161
|
|
|
223
|
-
|
|
162
|
+
This will poll in a regular interval and only resolve with tokens once the end-user authenticates.
|
|
163
|
+
|
|
164
|
+
### Client Credentials Grant
|
|
224
165
|
|
|
225
|
-
|
|
226
|
-
|
|
166
|
+
Client Credentials flow is for obtaining Access Tokens to use with third party APIs on behalf of your application, rather than an end-user which was the case in previous examples.
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
let scope!: string
|
|
170
|
+
let resource!: string
|
|
227
171
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
172
|
+
let tokens: client.TokenEndpointResponse = await lib.clientCredentialsGrant(
|
|
173
|
+
config,
|
|
174
|
+
{ scope, resource },
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
console.log('Token Endpoint Response', tokens)
|
|
233
178
|
```
|
|
234
179
|
|
|
235
|
-
|
|
236
|
-
other defined response properties.
|
|
180
|
+
## [API Reference](docs/README.md)
|
|
237
181
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
182
|
+
`openid-client` is distributed via [npmjs.com](https://www.npmjs.com/package/openid-client) and [github.com](https://github.com/panva/openid-client).
|
|
183
|
+
|
|
184
|
+
## [Examples](examples/README.md)
|
|
185
|
+
|
|
186
|
+
**`example`** ESM import
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
import * as client from 'openid-client'
|
|
243
190
|
```
|
|
244
191
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
192
|
+
- Authorization Code Flow (OAuth 2.0) - [source](examples/oauth.ts)
|
|
193
|
+
- Authorization Code Flow (OpenID Connect) - [source](examples/oidc.ts) | [diff](examples/oidc.diff)
|
|
194
|
+
- Extensions
|
|
195
|
+
- JWT Secured Authorization Request (JAR) - [source](examples/jar.ts) | [diff](examples/jar.diff)
|
|
196
|
+
- JWT Secured Authorization Response Mode (JARM) - [source](examples/jarm.ts) | [diff](examples/jarm.diff)
|
|
197
|
+
- Pushed Authorization Request (PAR) - [source](examples/par.ts) | [diff](examples/par.diff)
|
|
248
198
|
|
|
249
|
-
|
|
199
|
+
## Supported Runtimes
|
|
250
200
|
|
|
251
|
-
|
|
201
|
+
The supported JavaScript runtimes include those that support the utilized Web API globals and standard built-in objects. These are _(but are not limited to)_:
|
|
252
202
|
|
|
253
|
-
|
|
203
|
+
- Browsers
|
|
204
|
+
- Bun
|
|
205
|
+
- Cloudflare Workers
|
|
206
|
+
- Deno
|
|
207
|
+
- Electron
|
|
208
|
+
- Node.js[^nodejs]
|
|
209
|
+
- Vercel's Edge Runtime
|
|
254
210
|
|
|
255
|
-
|
|
256
|
-
const client = new issuer.Client({
|
|
257
|
-
client_id: 'zELcpfANLqY7Oqas',
|
|
258
|
-
client_secret: 'TQV5U29k1gHibH5bx1layBo0OSAvAbRT3UYW3EWrSYBB5swxjVfWUa1BS8lqzxG/0v9wruMcrGadany3',
|
|
259
|
-
});
|
|
211
|
+
## Supported Versions
|
|
260
212
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
213
|
+
| Version | Security Fixes π | Other Bug Fixes π | New Features β | Runtime and Module type |
|
|
214
|
+
| -------------------------------------------------------- | ----------------- | ------------------ | --------------- | ------------------------------- |
|
|
215
|
+
| [v6.x](https://github.com/panva/openid-client/tree/v6.x) | β
| β
| β
| Universal[^universal] ESM[^cjs] |
|
|
216
|
+
| [v5.x](https://github.com/panva/openid-client/tree/v5.x) | β
| β | β | Node.js CJS + ESM |
|
|
217
|
+
|
|
218
|
+
[sponsor-auth0]: https://auth0.com/signup?utm_source=external_sites&utm_medium=panva&utm_campaign=devn_signup
|
|
219
|
+
[WebCryptoAPI]: https://w3c.github.io/webcrypto/
|
|
220
|
+
[Fetch API]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
|
|
221
|
+
|
|
222
|
+
[^nodejs]: Node.js v20.x as baseline is required
|
|
223
|
+
|
|
224
|
+
[^universal]: Assumes runtime support of [WebCryptoAPI][] and [Fetch API][]
|
|
266
225
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
#### Semver?
|
|
270
|
-
|
|
271
|
-
**Yes.** Everything that's either exported in the TypeScript definitions file or
|
|
272
|
-
[documented][documentation] is subject to
|
|
273
|
-
[Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html). The rest is to be considered
|
|
274
|
-
private API and is subject to change between any versions.
|
|
275
|
-
|
|
276
|
-
#### How do I use it outside of Node.js
|
|
277
|
-
|
|
278
|
-
It is **only built for Node.js**. Other javascript runtimes are not supported.
|
|
279
|
-
I recommend [panva/oauth4webapi][oauth4webapi], or a derivate thereof, if you're
|
|
280
|
-
looking for a similarly compliant and certified client software that's not dependent
|
|
281
|
-
on the Node.js runtime builtins.
|
|
282
|
-
|
|
283
|
-
#### How to make the client send client_id and client_secret in the body?
|
|
284
|
-
|
|
285
|
-
See [Client Authentication Methods (docs)][documentation-methods].
|
|
286
|
-
|
|
287
|
-
#### Can I adjust the HTTP timeout?
|
|
288
|
-
|
|
289
|
-
See [Customizing (docs)][documentation-customizing].
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
[openid-connect]: https://openid.net/connect/
|
|
293
|
-
[feature-core]: https://openid.net/specs/openid-connect-core-1_0.html
|
|
294
|
-
[feature-discovery]: https://openid.net/specs/openid-connect-discovery-1_0.html
|
|
295
|
-
[feature-registration]: https://openid.net/specs/openid-connect-registration-1_0.html
|
|
296
|
-
[feature-revocation]: https://tools.ietf.org/html/rfc7009
|
|
297
|
-
[feature-introspection]: https://tools.ietf.org/html/rfc7662
|
|
298
|
-
[feature-mtls]: https://tools.ietf.org/html/rfc8705
|
|
299
|
-
[feature-device-flow]: https://tools.ietf.org/html/rfc8628
|
|
300
|
-
[feature-rp-logout]: https://openid.net/specs/openid-connect-rpinitiated-1_0.html
|
|
301
|
-
[feature-jarm]: https://openid.net/specs/oauth-v2-jarm.html
|
|
302
|
-
[feature-fapi]: https://openid.net/specs/openid-financial-api-part-2-1_0.html
|
|
303
|
-
[feature-dpop]: https://www.rfc-editor.org/rfc/rfc9449.html
|
|
304
|
-
[feature-par]: https://www.rfc-editor.org/rfc/rfc9126.html
|
|
305
|
-
[feature-jar]: https://www.rfc-editor.org/rfc/rfc9101.html
|
|
306
|
-
[feature-iss]: https://www.rfc-editor.org/rfc/rfc9207.html
|
|
307
|
-
[openid-certified-link]: https://openid.net/certification/
|
|
308
|
-
[passport-url]: http://passportjs.org
|
|
309
|
-
[npm-url]: https://www.npmjs.com/package/openid-client
|
|
310
|
-
[sponsor-auth0]: https://a0.to/try-auth0
|
|
311
|
-
[support-sponsor]: https://github.com/sponsors/panva
|
|
312
|
-
[documentation]: https://github.com/panva/node-openid-client/blob/main/docs/README.md
|
|
313
|
-
[documentation-issuer]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#issuer
|
|
314
|
-
[documentation-client]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#client
|
|
315
|
-
[documentation-customizing]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#customizing
|
|
316
|
-
[documentation-tokenset]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#tokenset
|
|
317
|
-
[documentation-strategy]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#strategy
|
|
318
|
-
[documentation-errors]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#errors
|
|
319
|
-
[documentation-generators]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#generators
|
|
320
|
-
[documentation-methods]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#client-authentication-methods
|
|
321
|
-
[documentation-webfinger]: https://github.com/panva/node-openid-client/blob/main/docs/README.md#issuerwebfingerinput
|
|
322
|
-
[express-openid-connect]: https://www.npmjs.com/package/express-openid-connect
|
|
323
|
-
[oauth4webapi]: https://github.com/panva/oauth4webapi#readme
|
|
226
|
+
[^cjs]: CJS style `require('openid-client')` is possible in Node.js versions where `process.features.require_module` is `true` or with the `--experimental-require-module` Node.js CLI flag.
|