@shad-claiborne/basic-oidc 1.1.4 → 1.1.6
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 +1 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -261,16 +261,19 @@ export declare class Client {
|
|
|
261
261
|
/**
|
|
262
262
|
* requestAccess
|
|
263
263
|
* @param authResponse AuthorizationResponse
|
|
264
|
-
* @param
|
|
264
|
+
* @param args object
|
|
265
265
|
* @returns Promise<TokenResponse>
|
|
266
266
|
*/
|
|
267
|
-
requestAccess(authResponse: AuthorizationResponse,
|
|
267
|
+
requestAccess(authResponse: AuthorizationResponse, params?: {
|
|
268
|
+
redirectUri?: string;
|
|
269
|
+
codeVerifier?: string;
|
|
270
|
+
}): Promise<TokenResponse>;
|
|
268
271
|
/**
|
|
269
272
|
* refreshAccess
|
|
270
273
|
* @param tokenSet TokenSet
|
|
271
|
-
* @returns Promise<
|
|
274
|
+
* @returns Promise<TokenResponse>
|
|
272
275
|
*/
|
|
273
|
-
refreshAccess(tokenSet: TokenSet): Promise<
|
|
276
|
+
refreshAccess(tokenSet: TokenSet): Promise<TokenResponse>;
|
|
274
277
|
/**
|
|
275
278
|
* revokeAccess
|
|
276
279
|
* @param tokenSet TokenSet
|
package/dist/index.js
CHANGED
|
@@ -431,24 +431,26 @@ class Client {
|
|
|
431
431
|
/**
|
|
432
432
|
* requestAccess
|
|
433
433
|
* @param authResponse AuthorizationResponse
|
|
434
|
-
* @param
|
|
434
|
+
* @param args object
|
|
435
435
|
* @returns Promise<TokenResponse>
|
|
436
436
|
*/
|
|
437
|
-
async requestAccess(authResponse,
|
|
437
|
+
async requestAccess(authResponse, params = {}) {
|
|
438
438
|
const tokenRequest = new TokenRequest(this);
|
|
439
439
|
if (authResponse.code === undefined)
|
|
440
440
|
throw new Error('authorization response did not include a code');
|
|
441
441
|
tokenRequest.setCode(authResponse.code)
|
|
442
442
|
.setGrantType('authorization_code');
|
|
443
|
-
if (
|
|
444
|
-
tokenRequest.
|
|
443
|
+
if (params.redirectUri)
|
|
444
|
+
tokenRequest.setRedirectUri(params.redirectUri);
|
|
445
|
+
if (params.codeVerifier)
|
|
446
|
+
tokenRequest.setCodeVerifier(params.codeVerifier);
|
|
445
447
|
const res = await axios_1.default.post(this.provider.getTokenEndpoint(), tokenRequest.toURLSearchParams());
|
|
446
448
|
return res.data;
|
|
447
449
|
}
|
|
448
450
|
/**
|
|
449
451
|
* refreshAccess
|
|
450
452
|
* @param tokenSet TokenSet
|
|
451
|
-
* @returns Promise<
|
|
453
|
+
* @returns Promise<TokenResponse>
|
|
452
454
|
*/
|
|
453
455
|
async refreshAccess(tokenSet) {
|
|
454
456
|
if (tokenSet.refresh_token === undefined)
|