Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.x doesn't work with some providers #420

Closed
2 tasks done
HitkoDev opened this issue Oct 28, 2021 · 1 comment · Fixed by #421
Closed
2 tasks done

v5.x doesn't work with some providers #420

HitkoDev opened this issue Oct 28, 2021 · 1 comment · Fixed by #421
Labels

Comments

@HitkoDev
Copy link
Contributor

HitkoDev commented Oct 28, 2021

Describe the bug
Some OAuth providers (notably login.microsoftonline.com) don't accept requests with Transfer-encoding: chunked, which is the default behaviour in NodeJS unless content-length header is provided.

To Reproduce
Steps to reproduce the behaviour:

    request(
        {
            form: { * payload * },
            method: 'POST',
            url: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
            headers: {},
        }
    )

Expected behaviour
Returns request response.

Actual behaviour
Throws OPError: expected 200 OK, got: 404 Not Found.

Environment:

  • openid-client version: v5.x.x
  • node version: all

Additional context
This was introduced by removing got dependency which took care of setting content-length header.

  • the bug is happening on latest openid-client too.
  • i have searched the issues tracker on github for similar issues and couldn't find anything related.
HitkoDev added a commit to HitkoDev/node-openid-client that referenced this issue Oct 28, 2021
@panva
Copy link
Owner

panva commented Oct 28, 2021

@HitkoDev thank you for bringing it up, i'll try and fix it promptly.

@panva panva added bug and removed triage labels Oct 28, 2021
@panva panva changed the title v4.x.x doesn't work with some providers v5.x doesn't work with some providers Oct 28, 2021
HitkoDev added a commit to HitkoDev/node-openid-client that referenced this issue Oct 28, 2021
panva pushed a commit that referenced this issue Oct 28, 2021
Closes #420
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants