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

google: allow to specify suggested domain #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/provider/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Google struct {
ClientSecret string `long:"client-secret" env:"CLIENT_SECRET" description:"Client Secret" json:"-"`
Scope string
Prompt string `long:"prompt" env:"PROMPT" default:"select_account" description:"Space separated list of OpenID prompt options"`
EmailDomain string `long:"email-domain" env:"EMAIL_DOMAIN" description:"Email domain the user is suggested to login with"`

LoginURL *url.URL
TokenURL *url.URL
Expand Down Expand Up @@ -61,6 +62,9 @@ func (g *Google) GetLoginURL(redirectURI, state string) string {
if g.Prompt != "" {
q.Set("prompt", g.Prompt)
}
if g.EmailDomain != "" {
q.Set("hd", g.EmailDomain)
}
q.Set("redirect_uri", redirectURI)
q.Set("state", state)

Expand Down