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

feedback on azidentity/cache #23388

Open
weinong opened this issue Aug 31, 2024 · 3 comments
Open

feedback on azidentity/cache #23388

weinong opened this issue Aug 31, 2024 · 3 comments
Assignees
Labels
Azure.Identity customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@weinong
Copy link

weinong commented Aug 31, 2024

  1. Why does Authenticate() method take *policy.TokenRequestOptions when GetToken() takes opts policy.TokenRequestOptions?
  2. Does TokenRequestOption have to be the same between Authenticate() and GetToken()? Using nil seems to work just fine with Authenticate(). Does it really matter?
  3. If I want the cache to be isolated by the user, am I supposed to use AuthenticationRecord.HomeAccountID to create the cache?
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Aug 31, 2024
@jhendrixMSFT jhendrixMSFT added Azure.Identity and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Sep 3, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Sep 3, 2024
@chlowell
Copy link
Member

chlowell commented Sep 3, 2024

Thanks for trying out persistent caching. I intend to ship a stable version of it this quarter, so please share any feedback you have soon ☺️

  1. Why does Authenticate() method take *policy.TokenRequestOptions when GetToken() takes opts policy.TokenRequestOptions?

The pointer is intended to express that TokenRequestOptions is truly optional for Authenticate(). Callers don't need to set any of its fields. However, GetToken() requires TokenRequestOptions.Scopes (I would agree it should therefore be a parameter, but it's too late to make that change).

  1. Does TokenRequestOption have to be the same between Authenticate() and GetToken()? Using nil seems to work just fine with Authenticate(). Does it really matter?

It probably doesn't matter to most applications. There are reasons to set TokenRequestOptions fields for Authenticate() though:

  • running in a private cloud (must specify Scopes)
  • to prevent a subsequent GetToken() call from sending a request
    • Authenticate() acquires an access token for ARM in the user's home tenant by default. Set Scopes to request a token for a difference audience and/or TenantID to acquire a token from a different tenant
  1. If I want the cache to be isolated by the user, am I supposed to use AuthenticationRecord.HomeAccountID to create the cache?

The Name option is the only isolation mechanism. Caches are partitioned by OS user. Is that what you want, or do you mean that you want to partition the cache by Entra user?

@chlowell chlowell self-assigned this Sep 3, 2024
@chlowell chlowell added needs-author-feedback Workflow: More information is needed from author to address the issue. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Sep 3, 2024
Copy link

github-actions bot commented Sep 3, 2024

Hi @weinong. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Copy link

Hi @weinong, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Untriaged
Development

No branches or pull requests

3 participants