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

Hash incompatibility with oauth2 gem #63

Open
chytreg opened this issue Jun 4, 2014 · 2 comments
Open

Hash incompatibility with oauth2 gem #63

chytreg opened this issue Jun 4, 2014 · 2 comments

Comments

@chytreg
Copy link

chytreg commented Jun 4, 2014

Why it's not easy to use omniauth-oauth2 with https://github.com/intridea/oauth2?

From omniauth i get credentials hash like this:

credentials do
  hash = {'token' => access_token.token}
  hash.merge!('refresh_token' => access_token.refresh_token) if access_token.expires? && access_token.refresh_token
  hash.merge!('expires_at' => access_token.expires_at) if access_token.expires?
  hash.merge!('expires' => access_token.expires?)
  hash
end

https://github.com/intridea/omniauth-oauth2/blob/master/lib/omniauth/strategies/oauth2.rb#L41

And it's impossible to use OAuth2::AccessToken.from_hash() method without modify the credentials hash https://github.com/intridea/oauth2/blob/master/lib/oauth2/access_token.rb#L45

@isaacsanders
Copy link
Contributor

Do you have a patch for this? I would be happy to accept a pull request to make this easier to use.

@bjeanes
Copy link

bjeanes commented Nov 25, 2016

I'm pretty sure this is fixed in newer oauth2 libraries. It checks for both Symbol and String keys which I assume was the issue here.

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