@@ -20,7 +20,7 @@ func main() {
20 log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
20 log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
21 flagSet := flag.NewFlagSet("oauth2_proxy", flag.ExitOnError)
21 flagSet := flag.NewFlagSet("oauth2_proxy", flag.ExitOnError)
23− googleAppsDomains := StringArray{}
23+ emailDomains := StringArray{}
24 upstreams := StringArray{}
24 upstreams := StringArray{}
25 skipAuthRegex := StringArray{}
25 skipAuthRegex := StringArray{}
@@ -35,7 +35,7 @@ func main() {
35 flagSet.Bool("pass-host-header", true, "pass the request Host Header to upstream")
35 flagSet.Bool("pass-host-header", true, "pass the request Host Header to upstream")
36 flagSet.Var(&skipAuthRegex, "skip-auth-regex", "bypass authentication for requests path's that match (may be given multiple times)")
36 flagSet.Var(&skipAuthRegex, "skip-auth-regex", "bypass authentication for requests path's that match (may be given multiple times)")
38− flagSet.Var(&googleAppsDomains, "google-apps-domain", "authenticate against the given Google apps domain (may be given multiple times)")
38+ flagSet.Var(&emailDomains, "email-domain", "authenticate emails with the specified domain (may be given multiple times). Use * to authenticate any email")
39 flagSet.String("github-org", "", "restrict logins to members of this organisation")
39 flagSet.String("github-org", "", "restrict logins to members of this organisation")
40 flagSet.String("github-team", "", "restrict logins to members of this team")
40 flagSet.String("github-team", "", "restrict logins to members of this team")
41 flagSet.String("client-id", "", "the OAuth Client ID: ie: \"123456.apps.googleusercontent.com\"")
41 flagSet.String("client-id", "", "the OAuth Client ID: ie: \"123456.apps.googleusercontent.com\"")
@@ -89,14 +89,14 @@ func main() {
89 os.Exit(1)
89 os.Exit(1)
92− validator := NewValidator(opts.GoogleAppsDomains, opts.AuthenticatedEmailsFile)
92+ validator := NewValidator(opts.EmailDomains, opts.AuthenticatedEmailsFile)
93 oauthproxy := NewOauthProxy(opts, validator)
93 oauthproxy := NewOauthProxy(opts, validator)
95− if len(opts.GoogleAppsDomains) != 0 && opts.AuthenticatedEmailsFile == "" {
95+ if len(opts.EmailDomains) != 0 && opts.AuthenticatedEmailsFile == "" {
96− if len(opts.GoogleAppsDomains) > 1 {
96+ if len(opts.EmailDomains) > 1 {
97− oauthproxy.SignInMessage = fmt.Sprintf("Authenticate using one of the following domains: %v", strings.Join(opts.GoogleAppsDomains, ", "))
97+ oauthproxy.SignInMessage = fmt.Sprintf("Authenticate using one of the following domains: %v", strings.Join(opts.EmailDomains, ", "))
98− } else {
98+ } else if opts.EmailDomains[0] != "*" {
99− oauthproxy.SignInMessage = fmt.Sprintf("Authenticate using %v", opts.GoogleAppsDomains[0])
99+ oauthproxy.SignInMessage = fmt.Sprintf("Authenticate using %v", opts.EmailDomains[0])