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

middleware onBefore is adding multiple Bearer tokens after initial request fails with 401 #18

Open
leandemon opened this issue Apr 24, 2018 · 3 comments

Comments

@leandemon
Copy link

When onFailure processes a 401 status code it adds a Bearer token (using $request->withHeader), then onBefore also adds a Bearer token but uses $request->withAddedHeader which effectively creates an Authorization Header that's got 2 duplicate Bearer tokens in it, causing authentication to fail.

Here's the Authorization header that actually gets sent:
Authorization: Bearer 5b3df637e24ace993fc5eb87967db5be92fc35df, Bearer 5b3df637e24ace993fc5eb87967db5be92fc35df

Looks like $request->withAddedHeader simply needs to be changed to $request->withHeader

@jsacksick
Copy link

Just experienced the same today... And lost hours due to this... (I know this got created almost 5 years ago, but figured I'd mention it).

@grambas
Copy link

grambas commented Dec 18, 2023

Some issue for me

@grambas
Copy link

grambas commented Dec 19, 2023

There is already PR for that: #23
Can anybody merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants