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

[Feature Request] Add overloads to DefaultCertificateLoader and DefaultCredentialLoader that accept a cancellation token #3128

Open
pmaytak opened this issue Nov 5, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request feature request good first issue Good for newcomers

Comments

@pmaytak
Copy link
Contributor

pmaytak commented Nov 5, 2024

Is your feature request related to a problem? Please describe.
It's a best practice to have async methods accept and honor a cancellation token. DefaultCredentialsLoader.LoadCredentialsIfNeededAsync uses a semaphore which accepts a cancellation token. We recommend to use this certificate loader when MSAL is used to acquire tokens. The recommendation is also to recreate an MSAL instance per request and pass cancellation tokens with timeouts where accepted. This means the call to load a certificate can be called per request. So we should have an API that passes a cancellation token to the semaphore.

Describe the solution you'd like
Add an overload that accepts a cancellation token to APIs in DefaultCertificateLoader and DefaultCredentialsLoader. Pass the token to the semaphore in LoadCredentialsIfNeededAsync.

@pmaytak pmaytak added enhancement New feature or request good first issue Good for newcomers feature request labels Nov 5, 2024
@agarwalishita
Copy link

Please assign this issue to me. Would like to contribute to this one.

@pmaytak
Copy link
Contributor Author

pmaytak commented Dec 9, 2024

@agarwalishita Would you still like to contribute to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants