Skip to content

Commit

Permalink
Add Override Option for Redirect URL
Browse files Browse the repository at this point in the history
  • Loading branch information
twz123 committed Jan 23, 2018
1 parent 66483c9 commit 5b2ef73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ solves this problem, but specifically for Google as Identity Provider.
--issuer-url= IdP Issuer URL to be contacted (default: https://accounts.google.com)
--client-id= Client ID to be used
--client-secret= Client Secret to be used
--redirect-url= Redirect URL to be communicated to the IdP (needs to indicate "out of band") (default: urn:ietf:wg:oauth:2.0:oob)

Help Options:
-h, --help Show this help message
Expand Down
3 changes: 2 additions & 1 deletion pkg/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Config struct {
IssuerURL string `long:"issuer-url" description:"IdP Issuer URL to be contacted" default:"https://accounts.google.com"`
ClientID string `long:"client-id" required:"yes" description:"Client ID to be used"`
ClientSecret string `long:"client-secret" required:"yes" description:"Client Secret to be used"`
RedirectURL string `long:"redirect-url" description:"Redirect URL to be communicated to the IdP (needs to indicate \"out of band\")" default:"urn:ietf:wg:oauth:2.0:oob"`
}

type OIDCFlow struct {
Expand Down Expand Up @@ -46,7 +47,7 @@ func NewOpenIDConnectFlow(config *Config) (*OIDCFlow, error) {
oauth2Config := &oauth2.Config{
ClientID: config.ClientID,
ClientSecret: config.ClientSecret,
RedirectURL: "urn:ietf:wg:oauth:2.0:oob",
RedirectURL: config.RedirectURL,

// Discovery returns the OAuth2 endpoints.
Endpoint: provider.Endpoint(),
Expand Down

0 comments on commit 5b2ef73

Please sign in to comment.