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

Provide built-in support for a token provider in Cosmos DB #20969

Closed
JeremyLikness opened this issue May 15, 2020 · 2 comments
Closed

Provide built-in support for a token provider in Cosmos DB #20969

JeremyLikness opened this issue May 15, 2020 · 2 comments
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.

Comments

@JeremyLikness
Copy link
Member

The Cosmos DB provider can use resource tokens for access. In some environments this must be asynchronously fetched after service initialization. Tokens also expire. Right now all token management must be done external to the provider.

Provide a configuration option for an asynchronous delegate that returns an endpoint and key. This would be fetched on creating the client the first time. Allow configuration that if there is an authorization issue, the delegate is called again in case the issue is the token expiration.

For server side solutions the delegate can be implemented to fetch the resource token from Cosmos directly. For client solutions it can be configured to make an API call to fetch the token.

For example:

ICosmosResourceAccess 
{
     string Endpoint;
     string Key;
}

Func<Task<ICosmosResourceAccess>> fetchToken;

UseCosmos(null, null, opt => opt.UseTokenProvider(
   async ()=> await MyProvider.FetchTokenAsync());
@AndriySvyryd
Copy link
Member

@JeremyLikness
Copy link
Member Author

Closing via #26491

@ajcvickers ajcvickers removed this from the Backlog milestone Nov 10, 2021
@ajcvickers ajcvickers added the closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. label Mar 10, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.
Projects
None yet
Development

No branches or pull requests

3 participants