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

Toggle off user agent custom header #1451

Open
raspy8766 opened this issue Aug 30, 2023 · 2 comments
Open

Toggle off user agent custom header #1451

raspy8766 opened this issue Aug 30, 2023 · 2 comments
Labels

Comments

@raspy8766
Copy link

raspy8766 commented Aug 30, 2023

Describe the bug

We currently use various auth providers for our auth servers across the company. Originally these webapps were built solely using Okta auth provider auth servers, so using Okta Auth JS and Okta React was straight-forward. In an effort to ease the transition towards this a new hybrid auth server environment we were hoping to let the web apps continue to use their existing OAuth library to authenticate with these other auth servers as well. So far this works great, except for one caveat, Okta Auth servers seem to have a unique header that allows a specific custom header in CORS request: X-Okta-User-Agent-Extended.

image

This of course, is not whitelisted in the other auth servers...and to my knowledge isn't something that can be configured. Given this header is primarily used for debugging purposes to easily view the okta versions in a HAR file or screenshots, I think it would be reasonable to propose that this custom header is set as a default, but there is a configuration option to disable it when a need arises to integrate with an auth server from another auth provider.

Reproduction Steps?

Create a non-Okta Auth Server and use the Okta Auth JS config to login

new OktaAuth(nonOktaOidcConfig).token.getWithRedirect()

Notice you will get a CORS error in the console due the custom X-Okta-User-Agent-Extended header.

SDK Versions

All versions use a custom header

Additional Information?

No response

@raspy8766 raspy8766 added the bug label Aug 30, 2023
@shuowu-okta
Copy link
Contributor

@raspy8766 Thanks for reporting the issue!

Internal ref: OKTA-644929

@jaredperreault-okta
Copy link
Contributor

In the meantime, you could provide a custom httpClient and strip off the header yourself

https://github.com/okta/okta-auth-js#httprequestclient

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

No branches or pull requests

3 participants