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

Using Azure App Registration with 'Mobile and desktop applications' fails refresh because of Origin header #671

Open
thijs-nijhuis opened this issue Jun 10, 2024 · 1 comment · May be fixed by #672

Comments

@thijs-nijhuis
Copy link

Description
We have an App Registration on Azure which used the 'Mobile and desktop applications' platform authentication. Getting a new token using the authorization code flows works as expected. But when a refresh of the token is needed, it fails with the following error

AADSTS9002326: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type. Request origin: 'http://localhost:8020'.

I think this is caused by the fact that the header is always set. Also for non-spa app registrations.

When getting a new token from scratch, a try/except strategy is used to make it work for both spa and non-spa platform. I think this would work here as well and also be more consistent.

Reproduction
I use dbt-databricks in which I encountered this error. Therefor, I do not have any stand alone code.

Expected behavior
Be able to refresh token for both SPA and 'Mobile and desktop applications' platforms.

Is it a regression?
I don't think so.

Debug Logs
N.A.

Other Information

  • OS: Windows
  • Version: 11 enterprise

Additional context
I will try to solve and test this and create a PR linking to this issue.

@thijs-nijhuis thijs-nijhuis linked a pull request Jun 10, 2024 that will close this issue
3 tasks
@thijs-nijhuis
Copy link
Author

Hi, can anyone please comment on this issue and perhaps trigger the test on the corresponding PR?

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

Successfully merging a pull request may close this issue.

1 participant