@@ -15,7 +15,7 @@ limitations under the License.
15
15
*/
16
16
17
17
import { jwtDecode } from "jwt-decode" ;
18
- import { OidcMetadata , SigninResponse } from "oidc-client-ts" ;
18
+ import { IdTokenClaims , OidcMetadata , SigninResponse } from "oidc-client-ts" ;
19
19
20
20
import { logger } from "../logger" ;
21
21
import { OidcError } from "./error" ;
@@ -139,28 +139,7 @@ export function isValidatedIssuerMetadata(
139
139
validateOIDCIssuerWellKnown ( metadata ) ;
140
140
}
141
141
142
- /**
143
- * Standard JWT claims.
144
- *
145
- * @see https://datatracker.ietf.org/doc/html/rfc7519#section-4.1
146
- */
147
- interface JwtClaims {
148
- [ claim : string ] : unknown ;
149
- /** The "iss" (issuer) claim identifies the principal that issued the JWT. */
150
- iss ?: string ;
151
- /** The "sub" (subject) claim identifies the principal that is the subject of the JWT. */
152
- sub ?: string ;
153
- /** The "aud" (audience) claim identifies the recipients that the JWT is intended for. */
154
- aud ?: string | string [ ] ;
155
- /** The "exp" (expiration time) claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. */
156
- exp ?: number ;
157
- // unused claims excluded
158
- }
159
- interface IdTokenClaims extends JwtClaims {
160
- nonce ?: string ;
161
- }
162
-
163
- const decodeIdToken = ( token : string ) : IdTokenClaims => {
142
+ export const decodeIdToken = ( token : string ) : IdTokenClaims => {
164
143
try {
165
144
return jwtDecode < IdTokenClaims > ( token ) ;
166
145
} catch ( error ) {
@@ -276,7 +255,7 @@ export type BearerTokenResponse = {
276
255
expires_in ?: number ;
277
256
// from oidc-client-ts
278
257
expires_at ?: number ;
279
- id_token ? : string ;
258
+ id_token : string ;
280
259
} ;
281
260
282
261
/**
0 commit comments