Skip to content

Commit

Permalink
fix: OAuth authorize call missing redirect_uri (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
radulucut authored Dec 18, 2024
1 parent 1615f6b commit 8c1db5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions globalping/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (c *client) Authorize(callback func(error)) (*AuthorizeResponse, error) {
q.Set("code_challenge_method", "S256")
q.Set("response_type", "code")
q.Set("scope", "measurements")
q.Set("redirect_uri", callbackURL)

return &AuthorizeResponse{
AuthorizeURL: c.authURL + "/oauth/authorize?" + q.Encode(),
Expand Down
1 change: 1 addition & 0 deletions globalping/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func Test_Authorize(t *testing.T) {
assert.Equal(t, "S256", u.Query().Get("code_challenge_method"))
assert.Equal(t, "code", u.Query().Get("response_type"))
assert.Equal(t, "measurements", u.Query().Get("scope"))
assert.Equal(t, expectedRedirectURI, u.Query().Get("redirect_uri"))

_, err = http.Post(res.CallbackURL+"?code=cod3", "application/x-www-form-urlencoded", nil)
if err != nil {
Expand Down

0 comments on commit 8c1db5d

Please sign in to comment.