Open laptopmutia opened 2 years ago
I don't have time to look into this fully at the moment, but you should make sure not to post secrets publicly
what is your guess about this then? if I want to debug it where I should start ?
What version of omniauth-oauth2 and regular oauth2 gem are you using
here are my omniauth and oauth2 gemfile lock
oauth2 (2.0.6)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
rash_alt (>= 0.4, < 1)
version_gem (~> 1.1)
omniauth (2.1.0)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-oauth2 (1.8.0)
oauth2 (>= 1.4, < 3)
omniauth (~> 2.0)
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
I use it with devise (4.8.1)
is it related with the auth token response that I get from the server? because the response is wrapped in
"data": { "access_token": "mytoken"}}
I think its because oauth2 I open this issue here https://github.com/oauth-xx/oauth2/issues/627
It looks like the issue was caused by the oauth keys being nested inside a data
top level object in the response. OP was able to override, and use a hash#dig
to fix it. Is this a wider issue we should collaborate on @BobbyMcWho ? Perhaps a config option to specify where nested oauth keys should be pulled from?
This could probably be solved with a custom strategy in the short term, we could add a feature like that in omniauth, but I'm currently out of town with little time, so it wouldn't be a priority anytime soon @pboling
here are my code is it because the server returning a JSON? because the token request is just work ok when I manually request it with CURL or postman/insomnia with
Content-Type and Accept application/json
here are my heroku logs
right after this line
Authentication failure! invalid_credentials: OAuth2::Error
is all the data that I need to get user infoin insomnia/postman the response are like this, is this because the response wrapped in data?
so I use this PR branch https://github.com/omniauth/omniauth-oauth2/pull/147 then I got this full messages