opperator/warden-oauth2

Warden::OAuth2::FailureApp is not using 'application/json'

Opened this issue · 0 comments

It's using the first content type passed in the Accept header:

➜ ~ curl -H 'Accept: text/plain, application/json' -i http://127.0.0.1:9292/v1/customers/search
HTTP/1.1 401 Unauthorized
Content-Type: text/plain
X-Accepted-Oauth-Scopes: default
Content-Length: 30
Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-02-16)
Date: Wed, 21 Mar 2012 19:23:03 GMT
Connection: Keep-Alive

{"error":"insufficient_scope"}%
➜ ~ curl -H 'Accept: application/json, text/plain' -i http://127.0.0.1:9292/v1/customers/search
HTTP/1.1 401 Unauthorized
Content-Type: application/json
X-Accepted-Oauth-Scopes: default
Content-Length: 30
Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-02-16)
Date: Wed, 21 Mar 2012 19:23:13 GMT
Connection: Keep-Alive

{"error":"insufficient_scope"}%