You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I'm seeing is that the fetch_tokens/3 function doesn't do any authentication, hence the code-for-token request fails with a 401. Full error details below:
** (MatchError) no match of right hand side value: {:error, :fetch_tokens, %HTTPoison.Response{body: "{\"error\":\"invalid_client\",\"error_description\":\"client authentication failed\"}", headers: [{"Pragma", "no-cache"}, {"Cache-Control", "no-cache, no-store"}, {"Content-Type", "application/json; charset=utf-8"}, {"Content-Length", "77"}, {"Date", "Sat, 24 Aug 2019 11:46:30 GMT"}, {"Connection", "keep-alive"}], request: %HTTPoison.Request{body: {:form, [client_id: "my-client", client_secret: "my-secret", code: "gU9qoumrVmlaFzOe3JI6ri6KYXG", grant_type: "authorization_code", redirect_uri: "http://localhost:4003/session"]}, headers: [{"Content-Type", "application/x-www-form-urlencoded"}], method: :post, options: [], params: %{}, url: "http://oidc:9090/token"}, request_url: "http://oidc:9090/token", status_code: 401}}
If I change the headers set by the fetch_tokens/3 function like this:
Since the OIDC specifies that this request should be authenticated, using HTTP Basic or JWT-based authentication, isn't this missing from this library?
I'll open a PR to fix this if it's needed, I'd just like to confirm this with you first.
Thanks in advance 🙌
The text was updated successfully, but these errors were encountered:
Tried to use Auth0 instead of the node-oidc-provider-based mock server and it worked as expected, since Auth0 accepts the client credentials on the HTTP POST body, as this library does.
Hi there 👋
First of all, thanks for this!
I'm trying to use this library locally against a mock OIDC Server (https://github.com/appvia/mock-oidc-user-server), that uses the
node-oidc-provider
under the hood.What I'm seeing is that the
fetch_tokens/3
function doesn't do any authentication, hence the code-for-token request fails with a 401. Full error details below:If I change the
headers
set by thefetch_tokens/3
function like this:The
fetch_tokens/3
function works as expected.Since the OIDC specifies that this request should be authenticated, using HTTP Basic or JWT-based authentication, isn't this missing from this library?
I'll open a PR to fix this if it's needed, I'd just like to confirm this with you first.
Thanks in advance 🙌
The text was updated successfully, but these errors were encountered: