@asgardeo/javascript 0.2.17 → 0.3.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.
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
import { IdToken } from '../models/token';
|
|
19
19
|
/**
|
|
20
20
|
* Removes standard protocol-specific claims from the ID token payload
|
|
21
|
-
* and returns
|
|
21
|
+
* and returns an object of user-specific claims with original attribute names preserved.
|
|
22
22
|
*
|
|
23
23
|
* @param payload The raw ID token payload.
|
|
24
|
-
* @returns A cleaned-up
|
|
24
|
+
* @returns A cleaned-up object containing only user-specific claims with original attribute names.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ````typescript
|
|
@@ -30,13 +30,15 @@ import { IdToken } from '../models/token';
|
|
|
30
30
|
* aud: 'client_id',
|
|
31
31
|
* exp: 1712345678,
|
|
32
32
|
* iat: 1712345670,
|
|
33
|
-
* email: 'user@example.com'
|
|
33
|
+
* email: 'user@example.com',
|
|
34
|
+
* given_name: 'John'
|
|
34
35
|
* };
|
|
35
36
|
*
|
|
36
37
|
* const userClaims = extractUserClaimsFromIdToken(idTokenPayload);
|
|
37
|
-
* //
|
|
38
|
+
* // userClaims will be:
|
|
38
39
|
* // {
|
|
39
|
-
* // email: 'user@example.com'
|
|
40
|
+
* // email: 'user@example.com',
|
|
41
|
+
* // given_name: 'John'
|
|
40
42
|
* // }
|
|
41
43
|
* ```
|
|
42
44
|
*/
|