connector: improve error message for callback URL mismatch

This commit is contained in:
rithu john 2017-06-13 15:52:33 -07:00
parent 1d7abf8923
commit 682d78f527
2 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@ func (c *githubConnector) oauth2Config(scopes connector.Scopes) *oauth2.Config {
func (c *githubConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) { func (c *githubConnector) LoginURL(scopes connector.Scopes, callbackURL, state string) (string, error) {
if c.redirectURI != callbackURL { if c.redirectURI != callbackURL {
return "", fmt.Errorf("expected callback URL did not match the URL in the config") return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
} }
return c.oauth2Config(scopes).AuthCodeURL(state), nil return c.oauth2Config(scopes).AuthCodeURL(state), nil

View File

@ -136,7 +136,7 @@ func (c *oidcConnector) Close() error {
func (c *oidcConnector) LoginURL(s connector.Scopes, callbackURL, state string) (string, error) { func (c *oidcConnector) LoginURL(s connector.Scopes, callbackURL, state string) (string, error) {
if c.redirectURI != callbackURL { if c.redirectURI != callbackURL {
return "", fmt.Errorf("expected callback URL did not match the URL in the config") return "", fmt.Errorf("expected callback URL %q did not match the URL in the config %q", callbackURL, c.redirectURI)
} }
return c.oauth2Config.AuthCodeURL(state), nil return c.oauth2Config.AuthCodeURL(state), nil
} }