@axa-fr/oidc-client 7.7.3 → 7.8.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 +10 -0
- package/dist/fetch.d.ts +3 -0
- package/dist/index.js +524 -505
- package/dist/index.umd.cjs +2 -2
- package/dist/oidcClient.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/fetch.ts +36 -0
- package/src/oidcClient.ts +5 -0
- package/src/user.ts +2 -1
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,9 @@ export const configuration = {
|
|
|
119
119
|
const href = window.location.href;
|
|
120
120
|
const oidcClient = OidcClient.getOrCreate()(configuration);
|
|
121
121
|
|
|
122
|
+
// Use the fetch bellow to inject access_token and DPOP tokens automatically
|
|
123
|
+
const oidcFetch = oidcClient.fetchWithTokens(fetch);
|
|
124
|
+
|
|
122
125
|
// You can inject you own fetch (default Fetch Interface) function and location object (respecting IOidcLocation interface)
|
|
123
126
|
// import {OidcLocation} from '@axa-fr/oidc-client'
|
|
124
127
|
// const oidcClient = OidcClient.getOrCreate(() => fetch, new OidcLocation())(configuration);
|
|
@@ -319,6 +322,13 @@ export class OidcClient {
|
|
|
319
322
|
*/
|
|
320
323
|
async getValidTokenAsync(waitMs = 200, numberWait = 50): Promise<ValidToken>;
|
|
321
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Retrieves a new fetch function that inject bearer tokens (also DPOP tokens).
|
|
327
|
+
* @param fetch The current fetch function to use
|
|
328
|
+
* @returns Fetch A new fectch function that inject bearer tokens (also DPOP tokens).
|
|
329
|
+
*/
|
|
330
|
+
getFetchWithTokens(fetch: Fetch): Fetch;
|
|
331
|
+
|
|
322
332
|
/**
|
|
323
333
|
* Retrieves OIDC user information.
|
|
324
334
|
* @param noCache Indicates whether user information should be retrieved bypassing the cache.
|
package/dist/fetch.d.ts
ADDED