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

invalid_request: Internal server error #3

Open
sergeygolubev opened this issue Nov 6, 2015 · 14 comments
Open

invalid_request: Internal server error #3

sergeygolubev opened this issue Nov 6, 2015 · 14 comments

Comments

@sergeygolubev
Copy link

Hello!

I try use Sinatra example of omniauth-bnet, and get this error:

Authentication Failed:
message:invalid_request
{"message"=>"invalid_request", "origin"=>"http://mysite.com/", "strategy"=>"bnet"}

I test this multiple times, on different versions of ruby and gems, but still get "Internal server error"
which no explanation.

Anyone can help me? :)

@tombell
Copy link

tombell commented Nov 10, 2015

I am encountering the same issues now.

@kelsin
Copy link
Contributor

kelsin commented Nov 10, 2015

Are you using a https redirect url? It's possible to end up with a non-ssl redirect url in Mashery which isn't allowed and can result in this error.

@tombell
Copy link

tombell commented Nov 11, 2015

I am using an http URL.

I, [2015-11-11T00:06:12.645325 #40792]  INFO -- omniauth: (bnet) Request phase initiated.
127.0.0.1 - - [11/Nov/2015:00:06:12 +0000] "GET /auth/bnet HTTP/1.1" 302 262 0.0100
I, [2015-11-11T00:06:14.091284 #40794]  INFO -- omniauth: (bnet) Callback phase initiated.
E, [2015-11-11T00:06:14.091766 #40794] ERROR -- omniauth: (bnet) Authentication failure! invalid_request: OmniAuth::Strategies::OAuth2::CallbackError, invalid_request | Internal server error
E, [2015-11-11T00:06:14.091905 #40794] ERROR -- omniauth: (bnet) Authentication failure! invalid_credentials: OmniAuth::Strategies::OAuth2::CallbackError, invalid_request | Internal server error
127.0.0.1 - - [11/Nov/2015:00:06:14 +0000] "GET /auth/bnet/callback?error=invalid_request&error_description=Internal%20server%20error&state=58d805fc61e15d97ee307e895fdbda3a9b66b2154747ad3b HTTP/1.1" 500 159298 0.0358

@kelsin
Copy link
Contributor

kelsin commented Nov 11, 2015

Battle.net oauth requires an https redirect url, switch that up and you should be good.

@tombell
Copy link

tombell commented Nov 11, 2015

Pushed to Heroku to test via http, still getting similar error:

2015-11-11T00:40:05.964274+00:00 app[web.1]: I, [2015-11-11T00:37:48.127661 #3]  INFO -- omniauth: (bnet) Request phase initiated.
2015-11-11T00:40:05.964274+00:00 app[web.1]: I, [2015-11-11T00:37:49.618274 #3]  INFO -- omniauth: (bnet) Callback phase initiated.
2015-11-11T00:40:05.964276+00:00 app[web.1]: E, [2015-11-11T00:37:50.776077 #3] ERROR -- omniauth: (bnet) Authentication failure! invalid_credentials: OAuth2::Error, invalid_request: Internal server error
2015-11-11T00:40:05.964277+00:00 app[web.1]: {"error":"invalid_request","error_description":"Internal server error"}

@kelsin
Copy link
Contributor

kelsin commented Nov 11, 2015

I just checked out the master branch of this project. Setup stunnel to setup a https proxy (my method of running local ssl). I then made sure that my test key had the correct redirect url setup on dev.battle.net and put the client id and secret into my environment as "BNET_ID" and "BNET_SECRET" (where the example sinatra app checks for it).

After doing that the app is working fine and logging me in and returning my actual battle tag.

Could your application on dev.battle.net not have the correct redirect_url for the new heroku app on it?

@tombell
Copy link

tombell commented Nov 11, 2015

I create a app:

Put in name 'Armory Plus (Dev)'
Put in website 'https://armory-plus.herokuapp.com'
Put in callback 'https://armory-plus.herokuapp.com/auth/bnet/callback'

Set my env vars for the specified key and secret.

I visit the auth URL, and it redirects me to https://armory-plus.herokuapp.com/auth/failure?message=invalid_credentials&strategy=bnet

@tombell
Copy link

tombell commented Nov 11, 2015

I also just checked out the example, and it errors with the exact same error. So I guess I'm doing something wrong when creating the app?

screen shot 2015-11-11 at 01 37 18

@sergeygolubev
Copy link
Author

Thanks for replies. I'll try to use HTTPS and let you know the results.

@tombell
Copy link

tombell commented Nov 12, 2015

@kelsin I figured it out, there is an issue in newer versions of omniauth-oauth2, so I locked it to an older version (1.3.1) and everything is working now.

@kelsin
Copy link
Contributor

kelsin commented Nov 12, 2015

That makes sense! I was using my Gemfile.lock from a long time ago, I will look at fixing what ever the problem is there. Thanks!

@tombell
Copy link

tombell commented Nov 12, 2015

Awesome, glad we figured it out, can continue building my app now! Thanks for the help.

@sergeygolubev
Copy link
Author

Hello!
omniauth-oauth2 1.3.1 really work when i change my callback url to https !!
Thanks for help!

@tombell
Copy link

tombell commented Nov 14, 2015

gem "omniauth-oauth2", "1.3.1"
gem "omniauth-bnet", "1.1.0"

cheshire137 added a commit to cheshire137/overwatch-team-comps that referenced this issue Mar 6, 2017
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