Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using async pattern for TokenValidation #1968

Closed
HarelM opened this issue Feb 5, 2024 · 3 comments · Fixed by #1982
Closed

Consider using async pattern for TokenValidation #1968

HarelM opened this issue Feb 5, 2024 · 3 comments · Fixed by #1982

Comments

@HarelM
Copy link
Member

HarelM commented Feb 5, 2024

What is the problem this feature will solve?

Infrastructure "tech debt"

What is the feature you are proposing to solve the problem?

Using the new syntax and infrastructure as described here:
AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#468

What alternatives have you considered or tried?

Keep the code as is.

Additional information

I'm not sure it's worth the trouble.
Last time I touched this part of the code I caused a deadlock for users trying to login, so this code is risky.
Having said that, it might be the "right way" to write this code, I'm not sure...

@HarelM
Copy link
Member Author

HarelM commented Mar 31, 2024

@alphaleonis I saw that you added a thumbs up, do you know by any chance how to use this token validator?
I tried gimini an chatGPT and failed.
The linked PR is simply to close this since it's not documented enough as I wrote in the linked issue in azure.

@alphaleonis
Copy link

@HarelM Oh, sorry, I don't think I ever intended to comment on this repo. I was probably led here by a link from the issue on the Azure AD repo without realizing I came to a new repository. It is not hard finding plenty of examples on the interwebs on how to use the JwtSecurityTokenHandler to validate tokens, the problem is doing this properly async due to the limitations mentioned in the linked issue.

@HarelM
Copy link
Member Author

HarelM commented Mar 31, 2024

I couldn't figure out how to use JsonWebTokenHandler which should've replaced JwtSecurityTokenHandler no matter how hard I tried to search for examples on Google... I eventually have up.
Currently, my code run the validation async and also uses an async cache.
So it's working I guess...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants