Skip to content

Commit 5b2ef73

Browse files
committed
Add Override Option for Redirect URL
1 parent 66483c9 commit 5b2ef73

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ solves this problem, but specifically for Google as Identity Provider.
1818
--issuer-url= IdP Issuer URL to be contacted (default: https://accounts.google.com)
1919
--client-id= Client ID to be used
2020
--client-secret= Client Secret to be used
21+
--redirect-url= Redirect URL to be communicated to the IdP (needs to indicate "out of band") (default: urn:ietf:wg:oauth:2.0:oob)
2122

2223
Help Options:
2324
-h, --help Show this help message

pkg/oidc/oidc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type Config struct {
1414
IssuerURL string `long:"issuer-url" description:"IdP Issuer URL to be contacted" default:"https://accounts.google.com"`
1515
ClientID string `long:"client-id" required:"yes" description:"Client ID to be used"`
1616
ClientSecret string `long:"client-secret" required:"yes" description:"Client Secret to be used"`
17+
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"`
1718
}
1819

1920
type OIDCFlow struct {
@@ -46,7 +47,7 @@ func NewOpenIDConnectFlow(config *Config) (*OIDCFlow, error) {
4647
oauth2Config := &oauth2.Config{
4748
ClientID: config.ClientID,
4849
ClientSecret: config.ClientSecret,
49-
RedirectURL: "urn:ietf:wg:oauth:2.0:oob",
50+
RedirectURL: config.RedirectURL,
5051

5152
// Discovery returns the OAuth2 endpoints.
5253
Endpoint: provider.Endpoint(),

0 commit comments

Comments
 (0)