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

allow user by subdomain #114

Open
moritan opened this issue Apr 30, 2019 · 12 comments
Open

allow user by subdomain #114

moritan opened this issue Apr 30, 2019 · 12 comments

Comments

@moritan
Copy link

moritan commented Apr 30, 2019

Hello,
Is it possible to define user whitelist by subdomain ? or do i need to do a docker instance ( and a config by subdomain ?

if i set domain to example.com.
I would be great to define a spécific whitelist for app1.example.com and another one for app2.example.com

maybe something like that (but better ;-) )

domains:
  - example.com

  # set allowAllUsers: true to use Vouch Proxy to just accept anyone who can authenticate at the configured provider
  # allowAllUsers: false

  # Setting publicAccess: true will accept all requests, even without a cookie. 
  # If the user is logged in, the cookie will be validated and the user header will be set.
  # You will need to direct people to the Vouch Proxy login page from your application.
  # publicAccess: false

  # whiteList 
  whiteList:
    - BySubdomain:
           name: app1
           users: 
                - [email protected]
                - [email protected]
     - BySubdomain:
           name: app2
           users: 
                - [email protected]
                - [email protected]

What could be great, is to define whitelist in a separate file whitelist.lst by example and be able to have filename like whitelist.{subdomain}.lst

@bnfinet
Copy link
Member

bnfinet commented Jul 17, 2019

@artagel has documented how to accomplish this using OpenResty...
https://github.com/vouch/vouch-proxy#advanced-authorization-using-openresty

It's not quite as simple as a whitelist per domain but it can be done.

@soulchips
Copy link

soulchips commented Oct 21, 2019

As a work around, i'm running 2 vouch servers on one instance but using different ports. So 9090 will map to x.domain.com and a config with its own whitelist while 9091 will be for y.domain.com but the config has a different white list.

I found this pretty easy to set up. the only other thing i had to do was tell nginx which subdomains should use which ports

@mmohaveri
Copy link

@bnfinet Are you interested in a PR adding this functionality? I personally need this feature and don't want to switch my whole stack from Nginx to OpenResty because of it.

@bnfinet
Copy link
Member

bnfinet commented Mar 23, 2020 via email

@bnfinet
Copy link
Member

bnfinet commented Mar 23, 2020

sorry @mmohaveri I was replying via email and didn't realize you were responding into an old thread.

Are you saying you need the subdomain functionality? Each user would be associated with a specific subdomain (or host)?

@mmohaveri
Copy link

Yes, I would prefer to have the option to whitelist specific users for specific domains while using Nginx.

@bnfinet
Copy link
Member

bnfinet commented Mar 24, 2020 via email

@bnfinet
Copy link
Member

bnfinet commented Mar 24, 2020

related #175

@mmohaveri
Copy link

Currently I'm using Gitea

Yeah, that's definitely possible, but a little too much for a simple whitelisting.

@bnfinet bnfinet changed the title User whitelist by domain ? allow user by subdomain? Jul 10, 2020
@bnfinet
Copy link
Member

bnfinet commented Jul 10, 2020

We'd like to transition away from whitelist to allow

@chiefbrain
Copy link

chiefbrain commented Dec 18, 2020

If client_id/client_secret would be configurable per (sub)domain, different clients for each site can be configured at the IdP.
Perhaps with the help of the map proposed in #302.

Another option would be to make the auth provider configurable per subdomain and allow multiple entries in oauth. This would be a clean solution regarding #302.

@bnfinet bnfinet changed the title allow user by subdomain? allow user by subdomain Dec 18, 2020
@strefli3
Copy link

The elegance of @moritan's original suggestions would still be a welcomed addition to Vouch from my knot hole.

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

6 participants