diff --git a/auth.go b/auth.go index 5beada8..4eedc0b 100644 --- a/auth.go +++ b/auth.go @@ -21,8 +21,8 @@ func (c *Client) GetAuthorizationCodeURL(redirectURI string, scopes []string) (s } return strings.Replace(c.APIBase, "api.", "", -1) + "/webapps/auth/protocol/openidconnect/v1/authorize?client_id=" + - url.QueryEscape(c.ClientID) + "&response_type=code&scope=" + strings.Join(scopes, "+") + - "&redirect_uri=" + url.QueryEscape(redirectURI), nil + c.ClientID + "&response_type=code&scope=" + strings.Join(scopes, "+") + + "&redirect_uri=" + redirectURI, nil } // GetAccessToken returns struct of TokenResponse diff --git a/examples/main.go b/examples/main.go index c17dff9..9a80e10 100644 --- a/examples/main.go +++ b/examples/main.go @@ -15,4 +15,7 @@ func main() { fmt.Println("ERROR: " + err.Error()) os.Exit(1) } + + url, err := client.GetAuthorizationCodeURL("http://test.com", []string{}) + fmt.Println("DEBUG: AuthCodeURL=" + url) }