auth0 6.4.0 → 7.0.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 +20 -15
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/lib/errors.d.ts +0 -18
- package/dist/cjs/lib/errors.js +1 -25
- package/dist/cjs/lib/middleware/auth0-client-telemetry.d.ts +3 -7
- package/dist/cjs/lib/middleware/auth0-client-telemetry.js +1 -25
- package/dist/cjs/lib/models.d.ts +0 -24
- package/dist/cjs/lib/models.js +0 -53
- package/dist/cjs/management/version.d.ts +1 -1
- package/dist/cjs/management/version.js +1 -1
- package/dist/cjs/management/wrapper/ManagementClient.d.ts +9 -2
- package/dist/cjs/management/wrapper/ManagementClient.js +0 -1
- package/dist/cjs/management/wrapper/token-provider.d.ts +4 -2
- package/dist/cjs/management/wrapper/token-provider.js +142 -11
- package/dist/cjs/utils.d.ts +0 -18
- package/dist/cjs/utils.js +1 -32
- package/dist/esm/index.d.mts +0 -2
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/lib/errors.d.mts +0 -18
- package/dist/esm/lib/errors.mjs +0 -22
- package/dist/esm/lib/middleware/auth0-client-telemetry.d.mts +3 -7
- package/dist/esm/lib/middleware/auth0-client-telemetry.mjs +1 -25
- package/dist/esm/lib/models.d.mts +0 -24
- package/dist/esm/lib/models.mjs +1 -49
- package/dist/esm/management/version.d.mts +1 -1
- package/dist/esm/management/version.mjs +1 -1
- package/dist/esm/management/wrapper/ManagementClient.d.mts +9 -2
- package/dist/esm/management/wrapper/ManagementClient.mjs +0 -1
- package/dist/esm/management/wrapper/token-provider.d.mts +4 -2
- package/dist/esm/management/wrapper/token-provider.mjs +142 -11
- package/dist/esm/utils.d.mts +0 -18
- package/dist/esm/utils.mjs +0 -30
- package/package.json +1 -2
- package/dist/cjs/auth/backchannel.d.ts +0 -158
- package/dist/cjs/auth/backchannel.js +0 -135
- package/dist/cjs/auth/base-auth-api.d.ts +0 -41
- package/dist/cjs/auth/base-auth-api.js +0 -109
- package/dist/cjs/auth/client-authentication.d.ts +0 -27
- package/dist/cjs/auth/client-authentication.js +0 -82
- package/dist/cjs/auth/database.d.ts +0 -157
- package/dist/cjs/auth/database.js +0 -94
- package/dist/cjs/auth/id-token-validator.d.ts +0 -18
- package/dist/cjs/auth/id-token-validator.js +0 -158
- package/dist/cjs/auth/index.d.ts +0 -65
- package/dist/cjs/auth/index.js +0 -80
- package/dist/cjs/auth/oauth.d.ts +0 -462
- package/dist/cjs/auth/oauth.js +0 -280
- package/dist/cjs/auth/passwordless.d.ts +0 -165
- package/dist/cjs/auth/passwordless.js +0 -173
- package/dist/cjs/auth/tokenExchange.d.ts +0 -166
- package/dist/cjs/auth/tokenExchange.js +0 -74
- package/dist/cjs/lib/index.d.ts +0 -3
- package/dist/cjs/lib/index.js +0 -18
- package/dist/cjs/lib/runtime.d.ts +0 -61
- package/dist/cjs/lib/runtime.js +0 -222
- package/dist/cjs/userinfo/index.d.ts +0 -87
- package/dist/cjs/userinfo/index.js +0 -104
- package/dist/esm/auth/backchannel.d.mts +0 -158
- package/dist/esm/auth/backchannel.mjs +0 -131
- package/dist/esm/auth/base-auth-api.d.mts +0 -41
- package/dist/esm/auth/base-auth-api.mjs +0 -103
- package/dist/esm/auth/client-authentication.d.mts +0 -27
- package/dist/esm/auth/client-authentication.mjs +0 -45
- package/dist/esm/auth/database.d.mts +0 -157
- package/dist/esm/auth/database.mjs +0 -90
- package/dist/esm/auth/id-token-validator.d.mts +0 -18
- package/dist/esm/auth/id-token-validator.mjs +0 -120
- package/dist/esm/auth/index.d.mts +0 -65
- package/dist/esm/auth/index.mjs +0 -60
- package/dist/esm/auth/oauth.d.mts +0 -462
- package/dist/esm/auth/oauth.mjs +0 -276
- package/dist/esm/auth/passwordless.d.mts +0 -165
- package/dist/esm/auth/passwordless.mjs +0 -169
- package/dist/esm/auth/tokenExchange.d.mts +0 -166
- package/dist/esm/auth/tokenExchange.mjs +0 -70
- package/dist/esm/lib/index.d.mts +0 -3
- package/dist/esm/lib/index.mjs +0 -2
- package/dist/esm/lib/runtime.d.mts +0 -61
- package/dist/esm/lib/runtime.mjs +0 -201
- package/dist/esm/userinfo/index.d.mts +0 -87
- package/dist/esm/userinfo/index.mjs +0 -98
package/dist/cjs/auth/oauth.d.ts
DELETED
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
import { InitOverride, JSONApiResponse, VoidApiResponse } from "../lib/runtime.js";
|
|
2
|
-
import { BaseAuthAPI, AuthenticationClientOptions } from "./base-auth-api.js";
|
|
3
|
-
import { IDTokenValidateOptions, IDTokenValidator } from "./id-token-validator.js";
|
|
4
|
-
export interface TokenSet {
|
|
5
|
-
/**
|
|
6
|
-
* The access token.
|
|
7
|
-
*/
|
|
8
|
-
access_token: string;
|
|
9
|
-
/**
|
|
10
|
-
* The refresh token, available with the `offline_access` scope.
|
|
11
|
-
*/
|
|
12
|
-
refresh_token?: string;
|
|
13
|
-
/**
|
|
14
|
-
* The user's ID Token.
|
|
15
|
-
*/
|
|
16
|
-
id_token?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The token type of the access token.
|
|
19
|
-
*/
|
|
20
|
-
token_type: "Bearer";
|
|
21
|
-
/**
|
|
22
|
-
* The duration in secs that the access token is valid.
|
|
23
|
-
*/
|
|
24
|
-
expires_in: number;
|
|
25
|
-
}
|
|
26
|
-
export interface GrantOptions {
|
|
27
|
-
idTokenValidateOptions?: Pick<IDTokenValidateOptions, "organization">;
|
|
28
|
-
initOverrides?: InitOverride;
|
|
29
|
-
}
|
|
30
|
-
export interface AuthorizationCodeGrantOptions {
|
|
31
|
-
idTokenValidateOptions?: IDTokenValidateOptions;
|
|
32
|
-
initOverrides?: InitOverride;
|
|
33
|
-
}
|
|
34
|
-
export interface ClientCredentials {
|
|
35
|
-
/**
|
|
36
|
-
* Specify this to override the parent class's `clientId`
|
|
37
|
-
*/
|
|
38
|
-
client_id?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Specify this to override the parent class's `clientSecret`
|
|
41
|
-
*/
|
|
42
|
-
client_secret?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Specify this to provide your own client assertion JWT rather than
|
|
45
|
-
* the class creating one for you from the `clientAssertionSigningKey`.
|
|
46
|
-
*/
|
|
47
|
-
client_assertion?: string;
|
|
48
|
-
/**
|
|
49
|
-
* If you provide your own `client_assertion` you should also provide
|
|
50
|
-
* the `client_assertion_type`.
|
|
51
|
-
*/
|
|
52
|
-
client_assertion_type?: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
|
|
53
|
-
}
|
|
54
|
-
export interface AuthorizationCodeGrantRequest extends ClientCredentials {
|
|
55
|
-
/**
|
|
56
|
-
* The Authorization Code received from the initial `/authorize` call.
|
|
57
|
-
*/
|
|
58
|
-
code: string;
|
|
59
|
-
/**
|
|
60
|
-
* This is required only if it was set at the `/authorize` endpoint. The values must match.
|
|
61
|
-
*/
|
|
62
|
-
redirect_uri?: string;
|
|
63
|
-
/**
|
|
64
|
-
* Allow for any custom property to be sent to Auth0
|
|
65
|
-
*/
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
}
|
|
68
|
-
export interface AuthorizationCodeGrantWithPKCERequest extends AuthorizationCodeGrantRequest {
|
|
69
|
-
/**
|
|
70
|
-
* Cryptographically random key that was used to generate the code_challenge passed to `/authorize`.
|
|
71
|
-
*/
|
|
72
|
-
code_verifier: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Represents a request for a client credentials grant in the OAuth 2.0 framework, specific to Auth0 implementation.
|
|
76
|
-
*
|
|
77
|
-
* @property audience - The unique identifier of the target API you want to access.
|
|
78
|
-
* @property organization - The identifier of the organization for which the request is being made.
|
|
79
|
-
*/
|
|
80
|
-
export interface ClientCredentialsGrantRequest extends ClientCredentials {
|
|
81
|
-
/**
|
|
82
|
-
* The unique identifier of the target API you want to access.
|
|
83
|
-
*/
|
|
84
|
-
audience: string;
|
|
85
|
-
organization?: string;
|
|
86
|
-
}
|
|
87
|
-
export interface PushedAuthorizationRequest extends ClientCredentials {
|
|
88
|
-
/**
|
|
89
|
-
* URI to redirect to.
|
|
90
|
-
*/
|
|
91
|
-
redirect_uri: string;
|
|
92
|
-
/**
|
|
93
|
-
* The response_type the client expects.
|
|
94
|
-
*/
|
|
95
|
-
response_type: string;
|
|
96
|
-
/**
|
|
97
|
-
* The response_mode to use.
|
|
98
|
-
*/
|
|
99
|
-
response_mode?: string;
|
|
100
|
-
/**
|
|
101
|
-
* The nonce.
|
|
102
|
-
*/
|
|
103
|
-
nonce?: string;
|
|
104
|
-
/**
|
|
105
|
-
* State value to be passed back on successful authorization.
|
|
106
|
-
*/
|
|
107
|
-
state?: string;
|
|
108
|
-
/**
|
|
109
|
-
* Name of the connection.
|
|
110
|
-
*/
|
|
111
|
-
connection?: string;
|
|
112
|
-
/**
|
|
113
|
-
* Scopes to request. Multiple scopes must be separated by a space character.
|
|
114
|
-
*/
|
|
115
|
-
scope?: string;
|
|
116
|
-
/**
|
|
117
|
-
* The unique identifier of the target API you want to access.
|
|
118
|
-
*/
|
|
119
|
-
audience?: string;
|
|
120
|
-
/**
|
|
121
|
-
* The organization to log the user in to.
|
|
122
|
-
*/
|
|
123
|
-
organization?: string;
|
|
124
|
-
/**
|
|
125
|
-
* The id of an invitation to accept.
|
|
126
|
-
*/
|
|
127
|
-
invitation?: string;
|
|
128
|
-
/**
|
|
129
|
-
* A Base64-encoded SHA-256 hash of the {@link AuthorizationCodeGrantWithPKCERequest.code_verifier} used for the Authorization Code Flow with PKCE.
|
|
130
|
-
*/
|
|
131
|
-
code_challenge?: string;
|
|
132
|
-
/**
|
|
133
|
-
* Allows JWT-Secured Authorization Request (JAR), when JAR & PAR request are used together. {@link https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow/authorization-code-flow-with-par-and-jar | Reference}
|
|
134
|
-
*/
|
|
135
|
-
request?: string;
|
|
136
|
-
/**
|
|
137
|
-
* A JSON stringified array of objects. It can carry fine-grained authorization data in OAuth messages as part of Rich Authorization Requests (RAR) {@link https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow/authorization-code-flow-with-rar | Reference}
|
|
138
|
-
*/
|
|
139
|
-
authorization_details?: string;
|
|
140
|
-
/**
|
|
141
|
-
* Allow for any custom property to be sent to Auth0
|
|
142
|
-
*/
|
|
143
|
-
[key: string]: any;
|
|
144
|
-
}
|
|
145
|
-
export interface PushedAuthorizationResponse {
|
|
146
|
-
/**
|
|
147
|
-
* The request URI corresponding to the authorization request posted.
|
|
148
|
-
* This URI is a single-use reference to the respective request data in the subsequent authorization request.
|
|
149
|
-
*/
|
|
150
|
-
request_uri: string;
|
|
151
|
-
/**
|
|
152
|
-
* This URI is a single-use reference to the respective request data in the subsequent authorization request.
|
|
153
|
-
*/
|
|
154
|
-
expires_in: number;
|
|
155
|
-
}
|
|
156
|
-
export interface PasswordGrantRequest extends ClientCredentials {
|
|
157
|
-
/**
|
|
158
|
-
* The unique identifier of the target API you want to access.
|
|
159
|
-
*/
|
|
160
|
-
audience?: string;
|
|
161
|
-
/**
|
|
162
|
-
* Resource Owner's identifier, such as a username or email address.
|
|
163
|
-
*/
|
|
164
|
-
username: string;
|
|
165
|
-
/**
|
|
166
|
-
* Resource Owner's secret.
|
|
167
|
-
*/
|
|
168
|
-
password: string;
|
|
169
|
-
/**
|
|
170
|
-
* String value of the different scopes the application is asking for. Multiple scopes are separated with whitespace.
|
|
171
|
-
*/
|
|
172
|
-
scope?: string;
|
|
173
|
-
/**
|
|
174
|
-
* String value of the realm the user belongs. Set this if you want to add realm support at this grant.
|
|
175
|
-
* For more information on what realms are refer to https://auth0.com/docs/get-started/authentication-and-authorization-flow/resource-owner-password-flow#realm-support.
|
|
176
|
-
*/
|
|
177
|
-
realm?: string;
|
|
178
|
-
}
|
|
179
|
-
export interface DeviceCodeGrantRequest {
|
|
180
|
-
/**
|
|
181
|
-
* Specify this to override the parent class's `clientId`
|
|
182
|
-
*/
|
|
183
|
-
client_id?: string;
|
|
184
|
-
/**
|
|
185
|
-
* The device code previously returned from the `/oauth/device/code` endpoint.
|
|
186
|
-
*/
|
|
187
|
-
device_code: string;
|
|
188
|
-
}
|
|
189
|
-
export interface RefreshTokenGrantRequest extends ClientCredentials {
|
|
190
|
-
/**
|
|
191
|
-
* The Refresh Token to use.
|
|
192
|
-
*/
|
|
193
|
-
refresh_token: string;
|
|
194
|
-
/**
|
|
195
|
-
* A space-delimited list of requested scope permissions.
|
|
196
|
-
* If not sent, the original scopes will be used; otherwise you can request a reduced set of scopes.
|
|
197
|
-
*/
|
|
198
|
-
scope?: string;
|
|
199
|
-
/**
|
|
200
|
-
* Allow for any custom property to be sent to Auth0
|
|
201
|
-
*/
|
|
202
|
-
[key: string]: any;
|
|
203
|
-
}
|
|
204
|
-
export interface RevokeRefreshTokenRequest extends ClientCredentials {
|
|
205
|
-
/**
|
|
206
|
-
* The Refresh Token you want to revoke.
|
|
207
|
-
*/
|
|
208
|
-
token: string;
|
|
209
|
-
}
|
|
210
|
-
export interface TokenExchangeGrantRequest {
|
|
211
|
-
/**
|
|
212
|
-
* Specify this to override the parent class's `clientId`
|
|
213
|
-
*/
|
|
214
|
-
client_id?: string;
|
|
215
|
-
/**
|
|
216
|
-
* Externally-issued identity artifact, representing the user.
|
|
217
|
-
*/
|
|
218
|
-
subject_token: string;
|
|
219
|
-
/**
|
|
220
|
-
* The unique identifier of the target API you want to access.
|
|
221
|
-
*/
|
|
222
|
-
audience?: string;
|
|
223
|
-
/**
|
|
224
|
-
* String value of the different scopes the application is requesting.
|
|
225
|
-
* Multiple scopes are separated with whitespace.
|
|
226
|
-
*/
|
|
227
|
-
scope?: string;
|
|
228
|
-
/**
|
|
229
|
-
* Optional element used for native iOS interactions for which profile updates can occur.
|
|
230
|
-
* Expected parameter value will be JSON in the form of: `{ name: { firstName: 'John', lastName: 'Smith }}`
|
|
231
|
-
*/
|
|
232
|
-
user_profile: string;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Options to exchange a federated connection token.
|
|
236
|
-
*/
|
|
237
|
-
export interface TokenForConnectionRequest {
|
|
238
|
-
/**
|
|
239
|
-
* The subject token to exchange for an access token for a connection.
|
|
240
|
-
*/
|
|
241
|
-
subject_token: string;
|
|
242
|
-
/**
|
|
243
|
-
* The target social provider connection (e.g., "google-oauth2").
|
|
244
|
-
*/
|
|
245
|
-
connection: string;
|
|
246
|
-
/**
|
|
247
|
-
* An optional subject token type parameter to pass to the authorization server. If not provided, it defaults to `urn:ietf:params:oauth:token-type:refresh_token`.
|
|
248
|
-
*/
|
|
249
|
-
subject_token_type?: SUBJECT_TOKEN_TYPES;
|
|
250
|
-
/**
|
|
251
|
-
* Optional login hint
|
|
252
|
-
*/
|
|
253
|
-
login_hint?: string;
|
|
254
|
-
}
|
|
255
|
-
export interface TokenForConnectionResponse {
|
|
256
|
-
access_token: string;
|
|
257
|
-
scope?: string;
|
|
258
|
-
expires_at: number;
|
|
259
|
-
connection: string;
|
|
260
|
-
[key: string]: unknown;
|
|
261
|
-
}
|
|
262
|
-
export declare enum SUBJECT_TOKEN_TYPES {
|
|
263
|
-
/**
|
|
264
|
-
* Constant representing the subject type for a refresh token.
|
|
265
|
-
* This is used in OAuth 2.0 token exchange to specify that the token being exchanged is a refresh token.
|
|
266
|
-
*
|
|
267
|
-
* @see {@link https://tools.ietf.org/html/rfc8693#section-3.1 RFC 8693 Section 3.1}
|
|
268
|
-
*/
|
|
269
|
-
REFRESH_TOKEN = "urn:ietf:params:oauth:token-type:refresh_token",
|
|
270
|
-
/**
|
|
271
|
-
* Constant representing the subject type for a access token.
|
|
272
|
-
* This is used in OAuth 2.0 token exchange to specify that the token being exchanged is an access token.
|
|
273
|
-
*
|
|
274
|
-
* @see {@link https://tools.ietf.org/html/rfc8693#section-3.1 RFC 8693 Section 3.1}
|
|
275
|
-
*/
|
|
276
|
-
ACCESS_TOKEN = "urn:ietf:params:oauth:token-type:access_token"
|
|
277
|
-
}
|
|
278
|
-
export declare const TOKEN_FOR_CONNECTION_GRANT_TYPE = "urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token";
|
|
279
|
-
/**
|
|
280
|
-
* @deprecated Use {@link SUBJECT_TOKEN_TYPES.REFRESH_TOKEN} instead.
|
|
281
|
-
*/
|
|
282
|
-
export declare const TOKEN_FOR_CONNECTION_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:refresh_token";
|
|
283
|
-
export declare const TOKEN_FOR_CONNECTION_REQUESTED_TOKEN_TYPE = "http://auth0.com/oauth/token-type/federated-connection-access-token";
|
|
284
|
-
export declare const TOKEN_URL = "/oauth/token";
|
|
285
|
-
/**
|
|
286
|
-
* OAuth 2.0 flows.
|
|
287
|
-
*/
|
|
288
|
-
export declare class OAuth extends BaseAuthAPI {
|
|
289
|
-
readonly idTokenValidator: IDTokenValidator;
|
|
290
|
-
constructor(options: AuthenticationClientOptions);
|
|
291
|
-
/**
|
|
292
|
-
* This is the flow that regular web apps use to access an API.
|
|
293
|
-
*
|
|
294
|
-
* Use this endpoint to exchange an Authorization Code for a Token.
|
|
295
|
-
*
|
|
296
|
-
* See: https://auth0.com/docs/api/authentication#authorization-code-flow44
|
|
297
|
-
*
|
|
298
|
-
* @example
|
|
299
|
-
* ```js
|
|
300
|
-
* const auth0 = new AuthenticationApi({
|
|
301
|
-
* domain: 'my-domain.auth0.com',
|
|
302
|
-
* clientId: 'myClientId',
|
|
303
|
-
* clientSecret: 'myClientSecret'
|
|
304
|
-
* });
|
|
305
|
-
*
|
|
306
|
-
* await auth0.oauth.authorizationCodeGrant({ code: 'mycode' });
|
|
307
|
-
* ```
|
|
308
|
-
*/
|
|
309
|
-
authorizationCodeGrant(bodyParameters: AuthorizationCodeGrantRequest, options?: AuthorizationCodeGrantOptions): Promise<JSONApiResponse<TokenSet>>;
|
|
310
|
-
/**
|
|
311
|
-
* PKCE was originally designed to protect the authorization code flow in mobile apps,
|
|
312
|
-
* but its ability to prevent authorization code injection makes it useful for every type of OAuth client,
|
|
313
|
-
* even web apps that use client authentication.
|
|
314
|
-
*
|
|
315
|
-
* See: https://auth0.com/docs/api/authentication#authorization-code-flow-with-pkce45
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* ```js
|
|
319
|
-
* const auth0 = new AuthenticationApi({
|
|
320
|
-
* domain: 'my-domain.auth0.com',
|
|
321
|
-
* clientId: 'myClientId',
|
|
322
|
-
* clientSecret: 'myClientSecret'
|
|
323
|
-
* });
|
|
324
|
-
*
|
|
325
|
-
* await auth0.oauth.authorizationCodeGrantWithPKCE({
|
|
326
|
-
* code: 'mycode',
|
|
327
|
-
* code_verifier: 'mycodeverifier'
|
|
328
|
-
* });
|
|
329
|
-
* ```
|
|
330
|
-
*/
|
|
331
|
-
authorizationCodeGrantWithPKCE(bodyParameters: AuthorizationCodeGrantWithPKCERequest, options?: AuthorizationCodeGrantOptions): Promise<JSONApiResponse<TokenSet>>;
|
|
332
|
-
/**
|
|
333
|
-
* This is the OAuth 2.0 grant that server processes use to access an API.
|
|
334
|
-
*
|
|
335
|
-
* Use this endpoint to directly request an Access Token by using the Client's credentials
|
|
336
|
-
* (a Client ID and a Client Secret or a Client Assertion).
|
|
337
|
-
*
|
|
338
|
-
* See: https://auth0.com/docs/api/authentication#client-credentials-flow
|
|
339
|
-
*
|
|
340
|
-
* @example
|
|
341
|
-
* ```js
|
|
342
|
-
* const auth0 = new AuthenticationApi({
|
|
343
|
-
* domain: 'my-domain.auth0.com',
|
|
344
|
-
* clientId: 'myClientId',
|
|
345
|
-
* clientSecret: 'myClientSecret'
|
|
346
|
-
* });
|
|
347
|
-
*
|
|
348
|
-
* await auth0.oauth.clientCredentialsGrant({ audience: 'myaudience' });
|
|
349
|
-
* ```
|
|
350
|
-
*/
|
|
351
|
-
clientCredentialsGrant(bodyParameters: ClientCredentialsGrantRequest, options?: {
|
|
352
|
-
initOverrides?: InitOverride;
|
|
353
|
-
}): Promise<JSONApiResponse<TokenSet>>;
|
|
354
|
-
/**
|
|
355
|
-
* This is the OAuth 2.0 extension that allows to initiate an OAuth flow from the backchannel instead of by building a URL.
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
* See: https://www.rfc-editor.org/rfc/rfc9126.html
|
|
359
|
-
*
|
|
360
|
-
* @example
|
|
361
|
-
* ```js
|
|
362
|
-
* const auth0 = new AuthenticationApi({
|
|
363
|
-
* domain: 'my-domain.auth0.com',
|
|
364
|
-
* clientId: 'myClientId',
|
|
365
|
-
* clientSecret: 'myClientSecret'
|
|
366
|
-
* });
|
|
367
|
-
*
|
|
368
|
-
* await auth0.oauth.pushedAuthorization({ response_type: 'id_token', redirect_uri: 'http://localhost' });
|
|
369
|
-
* ```
|
|
370
|
-
*/
|
|
371
|
-
pushedAuthorization(bodyParameters: PushedAuthorizationRequest, options?: {
|
|
372
|
-
initOverrides?: InitOverride;
|
|
373
|
-
}): Promise<JSONApiResponse<PushedAuthorizationResponse>>;
|
|
374
|
-
/**
|
|
375
|
-
* This information is typically received from a highly trusted public client like a SPA*.
|
|
376
|
-
* (<strong>*Note:</string> For single-page applications and native/mobile apps, we recommend using web flows instead.)
|
|
377
|
-
*
|
|
378
|
-
* See: https://auth0.com/docs/api/authentication#resource-owner-password
|
|
379
|
-
*
|
|
380
|
-
* @example
|
|
381
|
-
* ```js
|
|
382
|
-
* const auth0 = new AuthenticationApi({
|
|
383
|
-
* domain: 'my-domain.auth0.com',
|
|
384
|
-
* clientId: 'myClientId'
|
|
385
|
-
* clientSecret: 'myClientSecret'
|
|
386
|
-
* });
|
|
387
|
-
*
|
|
388
|
-
* await auth0.oauth.passwordGrant({
|
|
389
|
-
* username: 'myusername@example.com',
|
|
390
|
-
* password: 'mypassword'
|
|
391
|
-
* },
|
|
392
|
-
* { initOverrides: { headers: { 'auth0-forwarded-for': 'END.USER.IP.123' } } }
|
|
393
|
-
* );
|
|
394
|
-
* ```
|
|
395
|
-
*
|
|
396
|
-
* Set the'auth0-forwarded-for' header to the end-user IP as a string value if you want
|
|
397
|
-
* brute-force protection to work in server-side scenarios.
|
|
398
|
-
*
|
|
399
|
-
* See https://auth0.com/docs/get-started/authentication-and-authorization-flow/avoid-common-issues-with-resource-owner-password-flow-and-attack-protection
|
|
400
|
-
*
|
|
401
|
-
*/
|
|
402
|
-
passwordGrant(bodyParameters: PasswordGrantRequest, options?: GrantOptions): Promise<JSONApiResponse<TokenSet>>;
|
|
403
|
-
/**
|
|
404
|
-
* Use this endpoint to refresh an Access Token using the Refresh Token you got during authorization.
|
|
405
|
-
*
|
|
406
|
-
* See: https://auth0.com/docs/api/authentication#refresh-token
|
|
407
|
-
*
|
|
408
|
-
* @example
|
|
409
|
-
* ```js
|
|
410
|
-
* const auth0 = new AuthenticationApi({
|
|
411
|
-
* domain: 'my-domain.auth0.com',
|
|
412
|
-
* clientId: 'myClientId'
|
|
413
|
-
* clientSecret: 'myClientSecret'
|
|
414
|
-
* });
|
|
415
|
-
*
|
|
416
|
-
* await auth0.oauth.refreshTokenGrant({ refresh_token: 'myrefreshtoken' })
|
|
417
|
-
* ```
|
|
418
|
-
*/
|
|
419
|
-
refreshTokenGrant(bodyParameters: RefreshTokenGrantRequest, options?: GrantOptions): Promise<JSONApiResponse<TokenSet>>;
|
|
420
|
-
/**
|
|
421
|
-
* Use this endpoint to invalidate a Refresh Token if it has been compromised.
|
|
422
|
-
*
|
|
423
|
-
* The behaviour of this endpoint depends on the state of the <a href="https://auth0.com/docs/secure/tokens/refresh-tokens/revoke-refresh-tokens#refresh-tokens-and-grants">Refresh Token Revocation Deletes Grant</a> toggle.
|
|
424
|
-
* If this toggle is enabled, then each revocation request invalidates not only the specific token, but all other tokens based on the same authorization grant.
|
|
425
|
-
* This means that all Refresh Tokens that have been issued for the same user, application, and audience will be revoked.
|
|
426
|
-
* If this toggle is disabled, then only the refresh token is revoked, while the grant is left intact.
|
|
427
|
-
*
|
|
428
|
-
* See: https://auth0.com/docs/api/authentication#revoke-refresh-token
|
|
429
|
-
*
|
|
430
|
-
* @example
|
|
431
|
-
* ```js
|
|
432
|
-
* const auth0 = new AuthenticationApi({
|
|
433
|
-
* domain: 'my-domain.auth0.com',
|
|
434
|
-
* clientId: 'myClientId'
|
|
435
|
-
* clientSecret: 'myClientSecret'
|
|
436
|
-
* });
|
|
437
|
-
*
|
|
438
|
-
* await auth0.oauth.revokeRefreshToken({ token: 'myrefreshtoken' })
|
|
439
|
-
* ```
|
|
440
|
-
*/
|
|
441
|
-
revokeRefreshToken(bodyParameters: RevokeRefreshTokenRequest, options?: {
|
|
442
|
-
initOverrides?: InitOverride;
|
|
443
|
-
}): Promise<VoidApiResponse>;
|
|
444
|
-
/**
|
|
445
|
-
* Exchanges a subject token for an access token for the connection.
|
|
446
|
-
*
|
|
447
|
-
* The request body includes:
|
|
448
|
-
* - client_id (and client_secret/client_assertion via addClientAuthentication)
|
|
449
|
-
* - grant_type set to `urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token`
|
|
450
|
-
* - subject_token: the token to exchange
|
|
451
|
-
* - subject_token_type: the type of token being exchanged. Defaults to refresh tokens (`urn:ietf:params:oauth:token-type:refresh_token`).
|
|
452
|
-
* - requested_token_type (`http://auth0.com/oauth/token-type/federated-connection-access-token`) indicating that a federated connection access token is desired
|
|
453
|
-
* - connection name and an optional `login_hint` if provided
|
|
454
|
-
*
|
|
455
|
-
* @param bodyParameters - The options to retrieve a token for a connection.
|
|
456
|
-
* @returns A promise with the token response data.
|
|
457
|
-
* @throws An error if the exchange fails.
|
|
458
|
-
*/
|
|
459
|
-
tokenForConnection(bodyParameters: TokenForConnectionRequest, options?: {
|
|
460
|
-
initOverrides?: InitOverride;
|
|
461
|
-
}): Promise<JSONApiResponse<TokenSet>>;
|
|
462
|
-
}
|