Closed v0rs4 closed 1 year ago
I've come across this issue
unexpected status code: 401, response body: {"error":"invalid_client","error_description":"client authentication failed"}
N/A
Traditional Web
Apparently there's something wrong on this line
So,
I replaced
response, requestErr := client.PostForm(options.TokenEndpoint, values)
with
req, _ := http.NewRequest(http.MethodPost, options.TokenEndpoint, strings.NewReader(values.Encode())) req.Header.Add("Authorization", "Basic <<<BASE64_ENCODED(CLIENT_ID:CLIENT_SECRET)>>>") req.Header.Add("Content-Type", "application/x-www-form-urlencoded") response, requestErr := client.Do(req)
and it works now
I don't have deep knowledge in go but it seems that logtoClient.httpClient looses basic auth header somehow
go
logtoClient.httpClient
meet the same issue here
Fixed https://github.com/logto-io/go/pull/75
The new version was released. @v0rs4 @waltcow https://github.com/logto-io/go/releases/tag/v1.0.3
Describe the bug
I've come across this issue
Expected behavior
N/A
How to reproduce?
Traditional Web
applicationContext
N/A
Possible Fix
Apparently there's something wrong on this line
So,
I replaced
with
and it works now
I don't have deep knowledge in
go
but it seems thatlogtoClient.httpClient
looses basic auth header somehowScreenshots