question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Documentation] When should we consider for `ValidateTokenAsync`

See original GitHub issue

Documentation 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:open
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AndersAbelcommented, Apr 4, 2022

@brentschmaltz Yes, that sounds good. For my SAML2P package I can then bundle multiple generated identities from IdentityModel into one ClaimsPrincipal.

1reaction
AndersAbelcommented, Apr 4, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found