@axa-fr/oidc-client 7.4.1 → 7.5.1
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 +14 -2
- package/dist/crypto.d.ts +1 -0
- package/dist/index.js +798 -624
- package/dist/index.umd.cjs +2 -2
- package/dist/initSession.d.ts +6 -2
- package/dist/initWorker.d.ts +11 -7
- package/dist/jwt.d.ts +6 -0
- package/dist/login.d.ts +1 -1
- package/dist/oidc.d.ts +1 -0
- package/dist/oidcClient.d.ts +1 -0
- package/dist/requests.d.ts +9 -9
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/crypto.ts +11 -6
- package/src/initSession.ts +29 -9
- package/src/initWorker.ts +37 -10
- package/src/jwt.ts +248 -0
- package/src/login.ts +61 -21
- package/src/oidc.ts +68 -29
- package/src/oidcClient.ts +4 -0
- package/src/requests.ts +43 -10
- package/src/types.ts +1 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -30,8 +30,9 @@ We provide a wrapper **@axa-fr/react-oidc** for **React** (compatible next.js) a
|
|
|
30
30
|
@axa-fr/oidc-client is:
|
|
31
31
|
|
|
32
32
|
- **Secure** :
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
- With Demonstrating Proof of Possession (DPoP), your access_token and refresh_token are not usable outside your browser context (big protection)
|
|
34
|
+
- With the use of Service Worker, your tokens (refresh_token and/or access_token) are not accessible to the JavaScript client code (if you follow good practices from [`FAQ`](https://github.com/AxaFrance/oidc-client/blob/main/FAQ.md) section)
|
|
35
|
+
- OIDC using client side Code Credential Grant with pkce only
|
|
35
36
|
- **Lightweight** : Unpacked Size on npm is **274 kB**
|
|
36
37
|
- **Simple**
|
|
37
38
|
- refresh_token and access_token are auto refreshed in background
|
|
@@ -112,6 +113,7 @@ export const configuration = {
|
|
|
112
113
|
authority: 'https://demo.duendesoftware.com',
|
|
113
114
|
service_worker_relative_url: '/OidcServiceWorker.js',
|
|
114
115
|
service_worker_only: false,
|
|
116
|
+
demonstrating_proof_of_possession: false, // demonstrating proof of possession will work only if access_token is accessible from the client (This is because WebCrypto API is not available inside a Service Worker)
|
|
115
117
|
};
|
|
116
118
|
|
|
117
119
|
const href = window.location.href;
|
|
@@ -191,6 +193,7 @@ const configuration = {
|
|
|
191
193
|
monitor_session: Boolean, // Add OpenID monitor session, default is false (more information https://openid.net/specs/openid-connect-session-1_0.html), if you need to set it to true consider https://infi.nl/nieuws/spa-necromancy/
|
|
192
194
|
token_renew_mode: String, // Optional, update tokens based on the selected token(s) lifetime: "access_token_or_id_token_invalid" (default), "access_token_invalid", "id_token_invalid"
|
|
193
195
|
logout_tokens_to_invalidate: Array<string>, // Optional tokens to invalidate during logout, default: ['access_token', 'refresh_token']
|
|
196
|
+
demonstrating_proof_of_possession: Boolean, // Optional, default is false, if true, the the Demonstrating Proof of Possession will be activated //https://www.rfc-editor.org/rfc/rfc9449.html#name-protected-resource-access
|
|
194
197
|
};
|
|
195
198
|
```
|
|
196
199
|
|
|
@@ -316,6 +319,15 @@ export class OidcClient {
|
|
|
316
319
|
* @returns A promise resolved with the user information, or rejected with an error.
|
|
317
320
|
*/
|
|
318
321
|
async userInfoAsync<T extends OidcUserInfo = OidcUserInfo>(noCache = false): Promise<T>;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Generate Demonstration of proof of possession.
|
|
325
|
+
* @param accessToken The access token to use.
|
|
326
|
+
* @param url The url to use.
|
|
327
|
+
* @param method The method to use.
|
|
328
|
+
* @returns A promise resolved with the proof of possession.
|
|
329
|
+
*/
|
|
330
|
+
async generateDemonstrationOfProofOfPossessionAsync(accessToken:string, url:string, method:string): Promise<string>;
|
|
319
331
|
}
|
|
320
332
|
|
|
321
333
|
```
|
package/dist/crypto.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const generateRandom: (size: number) => string;
|
|
2
2
|
export declare function textEncodeLite(str: string): Uint8Array;
|
|
3
|
+
export declare function base64urlOfHashOfASCIIEncodingAsync(code: string): Promise<string>;
|
|
3
4
|
export declare const deriveChallengeAsync: (code: string) => Promise<string>;
|