Consider adding a TokenType property to SecurityTokenDescriptor
See original GitHub issueWhen creating an encrypted JWT using the CreateToken(SecurityTokenDescriptor tokenDescriptor)
API, the headers added to SecurityTokenDescriptor.AdditionalHeaderClaims
are only used for the JWE container and not the JWS. If you want to assign the JWS a specific typ
, you must first create an unencrypted token with AdditionalHeaderClaims
populated and then encrypt it manually, potentially with AdditionalHeaderClaims
populated too if you want both the JWE and the JWS to have a typ
header.
This procedure is a bit counter-intuitive and frankly error-prone. Things would be much simpler if SecurityTokenDescriptor
had a TokenType
property that would be used when creating both the JWS and the JWE.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
SecurityTokenDescriptor.TokenType Property
Gets or sets the token type. If provided, this will be added as the value for the 'typ' header parameter. In the case...
Read more >JWT token exception in ASP.Net (Lifetime validation failed. ...
So, I ended up not using the SecurityTokenDescriptor class because it expects DateTime objects to be assigned to Expirs and IssuedAt , or ......
Read more >Spring Boot Token based Authentication with Spring ...
Configure Spring Datasource, JPA, App properties. Under src/main/resources folder, open application.properties, add some new lines. For PostgreSQL spring.
Read more >netFramework/System.IdentityModel.Tokens.Jwt.xml 3.2.0
<param name="tokenType"> will be added as the value for the 'typ' claim in the ... Gets the key identifier for the security key...
Read more >Tokens
Describes the types of tokens related to identity and authentication and how they are used by Auth0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kevinchalet good idea. I marked this for 6.6.0.
Yep, overthinking it. We can cover it in comments.
@kevinchalet thanks for your help.