Closed fbritoferreira closed 8 years ago
The ability to provide a Regex in lieu of an array was added with this pull request.
This commit happened after the most recent version was released, so you'll have to clone and build the gem locally (demonstrated in Readme) in addition to including it in your gem file.
Just pushed a new gem.
@BriceShatzer Could you show a config example for a regex that take in everyone in a domain?
We use google as our provider, so the options object we use looks roughly like:
options = {
# OmniAuth::Builder block is passed as a proc
:providers => Proc.new do
provider :google_oauth2, "CONSUMER_KEY", "CONSUMER_SECRET"
end,
:authorized_users => /@bizname.com$/,
:protected_routes => ['/*'],
:dummy_auth => false
}
Precious::App.set(:omnigollum, options)
this prevents access to all pages unless the user authenticates with an email address that ends with the string "@bizname.com"
@BriceShatzer Thank you that actually worked.
@BriceShatzer Is there a way to have two domains?
you should be able to do:
:authorized_users => /@bizname.com$|@company.com$/,
@BriceShatzer Thank you
In the
Is there a option to have all user of a specific domain? For example do all users in @github.com can access the wiki while users with @example.org will not be able to do so.
Filipe