Don't pass the redirect URI through
It's always the same, might as well just get it where we need it.
This commit is contained in:
parent
4198f18d94
commit
901f65361a
2 changed files with 3 additions and 3 deletions
|
|
@ -56,12 +56,12 @@ type OAuthTokenResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the ArcGIS authorization URL with PKCE
|
// Build the ArcGIS authorization URL with PKCE
|
||||||
func buildArcGISAuthURL(clientID string, redirectURI string, expiration int) string {
|
func buildArcGISAuthURL(clientID string, expiration int) string {
|
||||||
baseURL := "https://www.arcgis.com/sharing/rest/oauth2/authorize/"
|
baseURL := "https://www.arcgis.com/sharing/rest/oauth2/authorize/"
|
||||||
|
|
||||||
params := url.Values{}
|
params := url.Values{}
|
||||||
params.Add("client_id", clientID)
|
params.Add("client_id", clientID)
|
||||||
params.Add("redirect_uri", redirectURI)
|
params.Add("redirect_uri", redirectURL())
|
||||||
params.Add("response_type", "code")
|
params.Add("response_type", "code")
|
||||||
//params.Add("code_challenge", generateCodeChallenge(codeVerifier))
|
//params.Add("code_challenge", generateCodeChallenge(codeVerifier))
|
||||||
//params.Add("code_challenge_method", "S256")
|
//params.Add("code_challenge_method", "S256")
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import (
|
||||||
|
|
||||||
func getArcgisOauthBegin(w http.ResponseWriter, r *http.Request) {
|
func getArcgisOauthBegin(w http.ResponseWriter, r *http.Request) {
|
||||||
expiration := 60
|
expiration := 60
|
||||||
authURL := buildArcGISAuthURL(ClientID, redirectURL(), expiration)
|
authURL := buildArcGISAuthURL(ClientID, expiration)
|
||||||
http.Redirect(w, r, authURL, http.StatusFound)
|
http.Redirect(w, r, authURL, http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue