-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[UI] OIDC authentication not working with Stylus extension installed #7851
Comments
My Org seems to be hitting this issue as well. Our Symptoms are identical: The browser-only OIDC flow in Firefox gets stuck in the pop up window, but with correct redirect and populated local storage as mentioned above. CLI login using Firefox works; Chrome works for both, too. We're using a self-hosted GitLab instance as our OIDC Provider, so this issue probably isn't specific to google's OIDC flow.
|
I've just tested and could reproduce in version |
Interesting. I use Firefox (on MacOS) as my daily browser and am not seeing this. I typically test OIDC against a Gitlab account. Some misc questions (for either of you):
cc: @meirish since you are probably most familiar with the redirect flow |
Indeed! In safe mode the redirect flow works fine. Knowing that, I've tried disabling my extensions one by one and have narrowed it down to Stylus. Installing this same extension on chrome gives the exact same problem. As for the other questions:
They get stuck on the way back from the provider, after login
It does not matter, it gets stuck either way. Now I guess the issue is to find out why that happens only with Vault and not with every other website that uses a similar OIDC redirect flow. I'll try to investigate how the code for this flow works and were it gets stuck. I won't close this issue just now, because I'd like to hear if @jktr's problem is the same or not. |
@Kasama Nice! Yep, I see the issue too if I install Stylus. |
I've found the culprit! A polyfill of Stylus somewhere sets a value to the localStorage to validate if it exists, which triggers a I'll create a pull request with my naive fix, which I'm not sure is the best. |
I've also updated the original post and title to reflect the root problem |
@Kasama: Yep, this seems to have been the issue on my end as well. It just so happened that I and all affected colleagues had Stylus installed. Thanks for taking the time to further investigate the issue! |
Describe the bug
When trying to authenticate with Google OIDC while having the Stylus extension installed, the popup window stays frozen for a couple of seconds (like in the image) then redirects to the
/ui/vault/auth
page again (second image), while the original one keeps waiting for the callback.Judging by the url of the popup, it tried to redirect correctly, but in the wrong window.
To Reproduce
Steps to reproduce the behavior:
nohup vault server -dev &
(the problem happens in my production server aswell)export VAULT_ADDR=http://localhost:8200
ROOT_TOKEN=$(cat nohup.out | grep "Root Token:" | cut -d' ' -f3)
http://localhost:8200/oidc/callback
andhttp://localhost:8200/ui/vault/auth/oidc/oidc/callback
authorized redirect urlsG_CLIENT_ID
is a variable that contains the google auth client ID andG_CLIENT_SECRET
is a variable that contains the google auth client secretvault login $ROOT_TOKEN
vault auth enable oidc
vault write auth/oidc/config default_role=gmail oidc_client_id=$G_CLIENT_ID oidc_discovery_url=https://accounts.google.com oidc_client_secret=$G_CLIENT_SECRET
vault write auth/oidc/role/gmail allowed_redirect_uris=http://localhost:8200/oidc/callback,http://localhost:8200/ui/vault/auth/oidc/oidc/callback bound_audiences=$G_CLIENT_ID policies=default user_claim=email oidc_scopes=email,profile
vault login -method=oidc
(should work fine)OIDC
in the authentication dropdown.Google Sign In
button to login with google.kill %1; rm nohup.out
and delete created Google API KeyExpected behavior
Login into the UI should succeed
Environment:
vault status
:vault version
:Vault v1.3.0
uname -a
:Darwin Kasama 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin
Mozilla Firefox 70.0
Vault server configuration file(s): any/default/not important
Additional context
I've noticed that when I successfully login in the popup window, the local storage gets populated with the OIDC information.
I think it's also worthy to note that the problem happened both in my work computer, my coworker's computer and my home computer.
If any further help is needed to reproduce the problem, please let me know
The text was updated successfully, but these errors were encountered: