Skip to content

Commit 64913c0

Browse files
authored
Merge pull request #2 from bgentry/bg-google-hd-param
google: allow to specify suggested domain
2 parents c8d4002 + b024ce1 commit 64913c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/provider/google.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type Google struct {
1414
ClientSecret string `long:"client-secret" env:"CLIENT_SECRET" description:"Client Secret" json:"-"`
1515
Scope string
1616
Prompt string `long:"prompt" env:"PROMPT" default:"select_account" description:"Space separated list of OpenID prompt options"`
17+
EmailDomain string `long:"email-domain" env:"EMAIL_DOMAIN" description:"Email domain the user is suggested to login with"`
1718

1819
LoginURL *url.URL
1920
TokenURL *url.URL
@@ -61,6 +62,9 @@ func (g *Google) GetLoginURL(redirectURI, state string) string {
6162
if g.Prompt != "" {
6263
q.Set("prompt", g.Prompt)
6364
}
65+
if g.EmailDomain != "" {
66+
q.Set("hd", g.EmailDomain)
67+
}
6468
q.Set("redirect_uri", redirectURI)
6569
q.Set("state", state)
6670

0 commit comments

Comments
 (0)