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] Token return from AcquireTokenByCredential doesn't contain RefreshToken #461

Open
zhetanuber opened this issue Oct 18, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@zhetanuber
Copy link

Is your feature request related to a problem? Please describe.
I am trying to use the AcquireTokenSilent for my service to service credential client auth call, but get error with "no token found"
The underlying issue is that no RefreshToken found.

I check the token response of AcquireTokenByCredential, it doesn't contain RefreshToken either
Not sure if I miss anything or this library doesn't support AcquireTokenSilent for service to service auth

Describe the solution you'd like
I follow this code client_secret_sample.go
But it doesn't work for my service to service call case.
Currently I don't have any cache solution unless I implement a cache on my service side, is there any other cache option for my case?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@zhetanuber zhetanuber added the enhancement New feature or request label Oct 18, 2023
@bgavrilMS
Copy link
Member

There is no refresh token in the client_credentials flow. Entra token issuer does not emit one. There is no need for one, because you can just use the secret / cert to get a fresh token.

AcquireTokenByCredential will pull tokens out of the cache on its own. You do not need to use AcquireTokenSilent. You do not need to serialize the cache, just keep a hold of the Confidential.Client object.

I have a PR out to update the sample:

#466

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

No branches or pull requests

2 participants