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

Allow callers to specify resource provider to avoid challenge responses #15651

Closed
heaths opened this issue Oct 2, 2020 · 10 comments
Closed

Allow callers to specify resource provider to avoid challenge responses #15651

heaths opened this issue Oct 2, 2020 · 10 comments
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved.
Milestone

Comments

@heaths
Copy link
Member

heaths commented Oct 2, 2020

In relation to #15650 we should allow callers to somehow specify the resource provider to authenticate the principal and issue a bearer token without requiring a challenge response from the service. I can think of a couple of different ways users might opt in, and feedback here is welcome:

  1. Add a property to an options class (perhaps in the clients that automatically use the policy from Add support for challenge-based auth to Azure.Core #15650) to specify the resource ID. If present, authenticate using that resource.
  2. Since most requests are problem for resources in the public cloud, default the resource provider in a client options class (it will vary) and have a separate property to opt into pre-authenticating the principal. Anyone on another cloud or Azure Stack can set the appropriate resource provider as needed.

This would reduce the number of network calls by at least 1.

@heaths heaths added Client This issue points to a problem in the data-plane of the library. Azure.Core feature-request This issue requires a new behavior in the product in order be resolved. labels Oct 2, 2020
@heaths
Copy link
Member Author

heaths commented Oct 2, 2020

It's also worth noting that exposing properties to opt into this behavior would likely have to be on the client options class anyway, since the client is typically adding this policy (if required) automatically anyway, without ever exposing it directly to the callers. And the default resource provider will also vary by client, most likely.

@jsquire
Copy link
Member

jsquire commented Aug 8, 2023

@heaths: Given that the Azure Identity team has changed guidance to recommend against auth challenges as a means for discovering the token scope, is this still needed?

@heaths
Copy link
Member Author

heaths commented Aug 8, 2023

This recommendation actually mitigates discovery: it's to be explicit with the scope so we don't have to scan the auth challenge or, potentially, even issue a challenge. That's what this is really about: avoiding the need to send an unauthenticated (and empty bodied) request just to get the scope.

/cc @schaabs

@pallavit
Copy link
Contributor

/cc: @christothes to weigh in.

@christothes
Copy link
Member

As @heaths notes above, this would be controlled by the client rather than Identity. The resource provider scope is controlled via the TokenRequestContext sent to GetToken

@christothes
Copy link
Member

I'd also note that trying to eliminate the first unauthenticated request may not be worth the time, as upcoming Entra Id features such as Proof of Possession tokens may require an initial unauthenticated request as well, in some scenarios.

@heaths
Copy link
Member Author

heaths commented Dec 13, 2023

I've been hearing about that as well. Still, if people aren't using it - unless the service would require it, (@jlichwa?) - many have asked for this over the years.

Still, given how long this has been open, we should probably discuss closing it. The main reason has been to eliminate the 401s from telemetry, but that's not an uncommon OAuth flow and should be ignored. Is the effort - both to implement and to use - worth eliminating occasional 401s that are non-errors like e.g., 429s?

@christothes
Copy link
Member

I've been hearing about that as well. Still, if people aren't using it - unless the service would require it, (@jlichwa Jack Lichwa FTE?) - many have asked for this over the years.

AFAIK, the only thing that would enforce this is a policy for the tenant. But I imagine it could become popular to use for enterprises, like MFA.

Still, given how long this has been open, we should probably discuss closing it. The main reason has been to eliminate the 401s from telemetry, but that's not an uncommon OAuth flow and should be ignored. Is the effort - both to implement and to use - worth eliminating occasional 401s that are non-errors like e.g., 429s?

My vote would be to close

@jlichwa
Copy link

jlichwa commented Dec 13, 2023

I agree that considering lack of alignment for this (there many opinions), and even if go that path, it is likely should be driven across resources vs Key Vault. I think we can close it for now, and once there is initiative to tackle this problem with broad customer communication, we can revisit it.

@pallavit
Copy link
Contributor

Given the conversation, I will close this issue for now and we can revisit in future as needed.

@heaths heaths closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

No branches or pull requests

5 participants