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

allowAllUsers does not skip domain validation anymore / no more open callback urls? #266

Closed
betagan opened this issue May 18, 2020 · 14 comments

Comments

@betagan
Copy link

betagan commented May 18, 2020

Hi,

the recent commit 85e98f66040be47a21aea8e67f7d33756811fc93 broke our existing config because it removes the possibility to skip domain validation by setting allowAllUsers. It now dies with

return fmt.Errorf("configuration error: oauth.callback_url (%s) must be within the configured domain where the cookie will be set %s", url, Cfg.Domains)

Was this an intended change? Asking because the config still tells you not to specify a domain if you set allowAllUsers:

Comment domains: out if you set allowAllUser:true

see https://github.com/vouch/vouch-proxy/blob/master/config/config.yml_example

Is there still a way to not specify a set of domains but let vouch handle all users that can authenticate (and use the respective callback urls we pass during that process)?

Best regards
Betagan

@bnfinet
Copy link
Member

bnfinet commented May 18, 2020 via email

@bnfinet
Copy link
Member

bnfinet commented May 18, 2020

Oh this isn't the login/logout commit, this is the callback validation. Yes please post a config.

Are users restricted to the domains in the callback(s)? What happens when you use those domains in vouch.domains? Does that meet your use case?

@bnfinet
Copy link
Member

bnfinet commented May 18, 2020

Upon further inspection there is probably a bug here related to the /login work, but it may be oauth.provider specific.

@betagan
Copy link
Author

betagan commented May 19, 2020

Hey,

thanks for looking into this. we use the following config which worked just fine up until we updated to the latest version of vouch proxy last week.

vouch:
  logLevel: debug
  #domains:
  #  - example.com
configured provider
  allowAllUsers: true
  jwt:
    secret: redacted
    issuer: redacted
    maxAge: 6000
  headers:
    claims:
      - groups
  testing: false
  cookie:
    maxAge: 6000
    secure: true
oauth:
  provider: oidc
  client_id: redacted
  client_secret: redacted
  auth_url: https://redacted.oktapreview.com/oauth2/default/v1/userinfo
  token_url: https://redacted.oktapreview.com/oauth2/default/v1/userinfo
  user_info_url: https://redacted.oktapreview.com/oauth2/default/v1/userinfo
  callback_url: https://example.com/auth

When we add the commented out domains section, it works again. However, we liked the previous behaviour where we didnt have to specify that.
We are using the OKTA OIDC provider if that's important to know.

In the commit I linked in my initial post, I saw that the following was removed:
if !viper.IsSet(Branding.LCName + ".allowAllUsers") {
which in my understanding now causes vouch proxy to always validate the domains no matter what allowAllUsers is set to. There might be a good reason for that, but I would have expected it to work differently based on the what the config file says. Should domains still be validated even though that flag is set?

@bnfinet
Copy link
Member

bnfinet commented May 19, 2020 via email

@bnfinet
Copy link
Member

bnfinet commented May 20, 2020

I ask because in your OP you mention...

and use the respective callback urls we pass during that process

which made me think you were using oauth.callback_urls not oauth.callback_url

@bnfinet bnfinet added the bug label May 22, 2020
@bnfinet
Copy link
Member

bnfinet commented May 22, 2020

I believe this is fixed in master though you'll likely need to add vouch.cookie.domain: example.com

Please do test and let me know what you find.

@bnfinet
Copy link
Member

bnfinet commented May 22, 2020

@betagan ^^

@bnfinet
Copy link
Member

bnfinet commented Jun 1, 2020

@betagan have you had an opportunity to test the fix? If you are no longer working this issue could you please close.

@yaws-k
Copy link

yaws-k commented Jun 6, 2020

Hi,
Probably I had the same issue (and misunderstanding of the configuration?).
Please let me confirm I could understand correctly.

I'm using 0.15.7 (Latest docker image) with Okta. The configuration is on my gist.
I recently started using vouch-proxy so I don't know how it worked before.

The config.yml_example_oidc tells to choose either specifying the domains or 'allowAllUsers: true'.

With 'allowAllUsers: true' only, vouch-proxy gets the following error.

configuration error: oauth.callback_url (https://vouch.example.com/auth) must be within a configured domains where the cookie will be set: either vouch.domains [] or vouch.cookie.domain

If I set both 'domains:' and 'allowAllUsers: true' according to the error message above, it returns;

configuration error: either one of vouch.domains or vouch.allowAllUsers needs to be set (but not both)

Finally, according to your comment above, manually adding the configurations worked fine.

I believe this is fixed in master though you'll likely need to add vouch.cookie.domain: example.com

vouch:
  allowAllUsers: true

  # Manually add the following lines
  cookie:
    domain: example.com

If it's the right way to enable 'allowAllUsers: true' to avoid listing all the related domains in the vouch.domains, it will be very helpful to add some description of the vouch.cookie.domain in the example files. I found there are descriptions about this parameter in the README, but I couldn't find out when to set this.

@yaws-k
Copy link

yaws-k commented Jun 12, 2020

It seems my understanding was correct since @bnfinet changed the label.
I'll have a look at config file examples this weekend to add descriptions about vouch.cookie.domain.

@bnfinet
Copy link
Member

bnfinet commented Jun 12, 2020

@yaws-k yes that's right

Sorry I should have replied explicitly. It's on my list to review/update the docs regarding that but I won't be able to pay attention to this until next week. PRs are of course always appreciated.

Thanks much.

@yaws-k
Copy link

yaws-k commented Jun 12, 2020

@bnfinet
Thank you for the clarification. Then I'll send a PR for config examples as a kind of candidate. Please review them if they are accurate when you have time. (They need to be checked since I'm not familiar with the golang and I don't have all environments for testing.)

bnfinet added a commit that referenced this issue Jun 25, 2020
commit a3e33f9
Merge: 0ea425f 054bff3
Author: Benjamin Foote <[email protected]>
Date:   Thu Jun 25 13:44:23 2020 -0700

    Merge branch 'master' into pr/yaws-k/279

commit 0ea425f
Author: Benjamin Foote <[email protected]>
Date:   Thu Jun 25 13:44:12 2020 -0700

    #266 clarify protected domain

commit 2b68660
Author: Yosuke Kato <[email protected]>
Date:   Sun Jun 14 14:27:22 2020 +0900

    Add vouch.cookie.domain description to allAllUsers configuration.
@bnfinet
Copy link
Member

bnfinet commented Jun 25, 2020

thanks @yaws-k for the documentation fix

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

No branches or pull requests

3 participants