File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
src/Pages/Home/JwtDecoder Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 114
114
case ' kid' :
115
115
return ' // Key ID, identifying which key was used to sign the JWT' ;
116
116
case ' typ' :
117
- return ' // Type of the token, typically "JWT" ' ;
117
+ return ` // Token type: ${ explainTokenType (value) } ` ;
118
118
case ' cty' :
119
119
return ' // Content type, similar to MIME type, indicating the media type of the JWT.' ;
120
120
case ' jwk' :
233
233
}
234
234
}
235
235
236
+ function explainTokenType (type ) {
237
+ switch (type .toLowerCase ()) {
238
+ case ' jwt' :
239
+ case ' http://openid.net/specs/jwt/1.0' :
240
+ return ' JSON Web Token' ;
241
+ case ' jws' :
242
+ return ' JSON Web Signature, a signed JWT' ;
243
+ case ' jwe' :
244
+ return ' JSON Web Encryption, an encrypted JWT' ;
245
+ case ' at+jwt' :
246
+ return ' Access Token' ;
247
+ case ' token-introspection+jwt' :
248
+ return ' JWT response from the Introspection endpoint' ;
249
+ case ' secevent+jwt' :
250
+ return ' Security Event Token' ;
251
+ default :
252
+ return type;
253
+ }
254
+ }
255
+
236
256
function convertEpoch (epoch ) {
237
257
if (typeof epoch === ' number' ) {
238
258
const date = new Date (epoch * 1000 );
You can’t perform that action at this time.
0 commit comments