Refactoring and more implementation

This commit is contained in:
David J. Allen 2024-02-24 21:05:05 -07:00
parent ac80ba929c
commit eb43261b91
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
5 changed files with 293 additions and 229 deletions

View file

@ -36,15 +36,7 @@ func RandomString(n int) string {
return string(b)
}
func BuildAuthorizationUrl(authEndpoint string, clientId string, redirectUri []string, state string, responseType string, scope []string) string {
return authEndpoint + "?" + "client_id=" + clientId +
"&redirect_uri=" + EncodeURL(strings.Join(redirectUri, ",")) +
"&response_type=" + responseType +
"&state=" + state +
"&scope=" + strings.Join(scope, "+")
}
func EncodeURL(s string) string {
func URLEscape(s string) string {
return url.QueryEscape(s)
}