From 682d78f527798b7b47fd8152177cd9d9d167cbdd Mon Sep 17 00:00:00 2001 From: rithu john Date: Tue, 13 Jun 2017 15:52:33 -0700 Subject: [PATCH] connector: improve error message for callback URL mismatch --- connector/github/github.go | 2 +- connector/oidc/oidc.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connector/github/github.go b/connector/github/github.go index 4b03b188..c483246b 100644 --- a/connector/github/github.go +++ b/connector/github/github.go @@ -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) { 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 diff --git a/connector/oidc/oidc.go b/connector/oidc/oidc.go index db9c641f..42be1e89 100644 --- a/connector/oidc/oidc.go +++ b/connector/oidc/oidc.go @@ -136,7 +136,7 @@ func (c *oidcConnector) Close() error { func (c *oidcConnector) LoginURL(s connector.Scopes, callbackURL, state string) (string, error) { 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 }