Skip to content

Commit

Permalink
Use HCP token endpoint (#114)
Browse files Browse the repository at this point in the history
* Use HCP token endpoint

* Update httpclient tests
  • Loading branch information
tbalasavage authored Aug 25, 2022
1 parent d009766 commit 50dbf4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

var (
tokenPath string = "/oauth/token"
tokenPath string = "/oauth2/token"
)

// WithClientCredentials returns an http client with an access token obtained using the configured client credentials.
Expand Down
4 changes: 2 additions & 2 deletions config/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

const (
// defaultAuthURL is the URL of the production auth endpoint.
defaultAuthURL = "https://auth.hashicorp.com"
defaultAuthURL = "https://auth.idp.hashicorp.com"

// defaultPortalURL is the URL of the production portal.
defaultPortalURL = "https://portal.cloud.hashicorp.com"
Expand All @@ -31,7 +31,7 @@ const (
aud = "https://api.hashicorp.cloud"

// tokenPath is the path used to retrieve the access token.
tokenPath string = "/oauth/token"
tokenPath string = "/oauth2/token"
)

// NewHCPConfig will return a HCPConfig. The configuration will be constructed
Expand Down
2 changes: 1 addition & 1 deletion httpclient/httpclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

func TestNew(t *testing.T) {

tokenPath := "/oauth/token"
tokenPath := "/oauth2/token"
token := "90d64460d14870c08c81352a05dedd3465940a7c"
clientID := "CLIENT_ID"
clientSecret := "CLIENT_SECRET"
Expand Down

0 comments on commit 50dbf4d

Please sign in to comment.