[Documentation] When should we consider for `ValidateTokenAsync`
See original GitHub issueDocumentation related to component
Currently, we had ValidateToken
and ValidateTokenAsync
, for example, when we’re using JwtSecurityTokenHandler
should we prefer using the ValidateTokenAsync
introduced in 6.16.0.
From what I can see, the ValidateTokenAsync
could not replace the ValidateToken
completely,
the ValidateToken
method is returning a ClaimsPrincipal
, while the ValidateTokenAsync
method is returning a TokenValidationResult
model which contains a ClaimsIdentity
but not contains a ClaimsPrincipal
Please check all that apply
- typo
- documentation doesn’t exist
- documentation needs clarification
- error(s) in the example
- needs an example
Description of the issue
Need some guidance for the ValidateTokenAsync
method
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
JwtSecurityTokenHandler.ValidateTokenAsync Method
Validates a token. On a validation failure, no exception will be thrown; instead, the exception will be set in the returned TokenValidationResult.
Read more >Upgrade Microsoft.IdentityModel.Protocols.OpenIdConnect ...
Currently, we're using Microsoft.IdentityModel.Protocols.OpenIdConnect 6.10.0, and the ValidateToken method is a .sync-operation.
Read more >Creating And Validating JWT Tokens In C# .NET
Let's first take a look at how to create JWT tokens manually. For our example, we will simply create a service that returns...
Read more >How do I validate a JWT using JwtSecurityTokenHandler ...
I am prototyping the use of IdentityServer4 to secure several services, with the caveat that those services will likely not be migrated (in...
Read more >Create a Custom Security Provider | Wyn Documentation
Wyn Enterprise allows you to create a custom security provider easily. A custom security provider is a compiled DLL file that implements the...
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
@brentschmaltz Yes, that sounds good. For my SAML2P package I can then bundle multiple generated identities from IdentityModel into one ClaimsPrincipal.
@brentschmaltz Multiple assertions in the same SAML2 response is a rare thing, I’ve never heard of it being used, although it is allowed in the spec. For the Web SSO profile, there is a requirement that all identities refer to the same subject, so in that case it would actually work that
IsInRole
checks all identities. But I guess that anyone using multiple identities would probably not use the principal IsInRole anyway.