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

[Bugfix] Bearer Token Authentication was generating wrong header value #52

Merged
merged 4 commits into from
Sep 27, 2017

Conversation

bogdanRada
Copy link
Contributor

@bogdanRada bogdanRada commented Apr 27, 2017

Hello,
I was trying today to update my gem asana_exception_notifier which has a dependency to this gem when i discovered that i was getting a warning :

Warning: FaradayMiddleware::OAuth2 initialized with default token_type - token will be added as both a query string parameter and an Authorization header. In the next major release, tokens will be added exclusively as an Authorization header by default. Please visit https://github.com/lostisland/faraday_middleware/wiki for more information.

After debugging the calls i was making to Asana API, i discovered that this gem was not configured properly for bearer token authentication, and because of that Faraday was generating a wrong header

Authorization: "Token token=\"some_token_here\""

instead of

Authorization: "Bearer some_token_here"

This pull requests configures correctly the Faraday configuration in the class Asana::Authentication::OAuth2::BearerTokenAuthentication

Also added tests for checking that the header generated by Faraday is correct, and integrated Appraisal gem also so that we can test backward compatibility.

Alll tests are passing locally .

Please let me know what you think. If you want i can keep the old way the gem was working and make another class for this and setup a new authorization type in the Configuration class if needed.

Thank you very much.

┆Issue is synchronized with this Asana task

@bogdanRada bogdanRada changed the title Bearer Token Authentication was generating wrong headers [Bugfix] Bearer Token Authentication was generating wrong headers Apr 27, 2017
@bogdanRada bogdanRada changed the title [Bugfix] Bearer Token Authentication was generating wrong headers [Bugfix] Bearer Token Authentication was generating wrong header value Apr 27, 2017
@bogdanRada
Copy link
Contributor Author

can someone please review this pull request? it's been almost 2 months...

@jjschnei jjschnei merged commit bde5835 into Asana:master Sep 27, 2017
@bogdanRada
Copy link
Contributor Author

thanks @jjschnei for merging this changes :)

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants