-
Notifications
You must be signed in to change notification settings - Fork 194
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
Azure AD Single Page Application should include Origin
header for CORS support
#1048
Comments
Hmm, it appears I found a better workaround. If I remove the "Single Page Application" completely in Azure, and instead use a "Mobile and desktop applications", the Client Secret is not required. Simply adding the "Mobile and desktop applications" was not sufficient, I had to also remove the "Single Page Application". We can succeed simply with:
So, perhaps the guidance should be to use |
Revisiting this now... I learned recently that Azure AD applications of type I confirmed that simply adding a header in the request solves this issue. Here is an example: This command fails:
This command succeeds (simply adding
Therefore, I would like to bring this issue back up for consideration. I'm happy to make a PR after receiving guidance for how best to proceed. |
In order to implement this code, I think we need to implement the change 2 libraries upstream. This library uses https://github.com/int128/oauth2cli/tree/master which in turn uses https://github.com/golang/oauth2/tree/master. The logic to actually request the token is here: https://github.com/golang/oauth2/blob/master/internal/token.go#L183-L202. Plumbing through the call back URL as a parameter seems like a relatively large lift in this case. We do have a |
Purpose of the feature (why)
We would like to use Azure AD Single Page Application with PKCE and no client secret. However, after configuring
kubelogin
for such a setup, we receive an error:After digging a bit more, it seems that Azure requires the request to populate the
Origin
header for this flow to succeed. See:For a related github issue, see #858
Your idea (how)
I'm hoping that we can include a
Origin
header in these requests to resolve this error. A couple options to consider for this are:Origin
header manually in the HTTP client. We can either put this behind a feature flag, or just choose to add this header to all requests.--extra-header="Origin: localhost:8000"
)If we decide on a solution, I'm happy to take an initial pass at making the PR.
Workaround
This issue can be worked around by instead configuring the Azure Application to be a "Mobile and desktop applications". However, this requires us to include the "Client Secret" in all client's kubeconfig files, which is not desirable.
The text was updated successfully, but these errors were encountered: