Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Seeing a 401 on fresh server boot #46

Open
jphenow opened this issue Aug 29, 2012 · 0 comments
Open

Seeing a 401 on fresh server boot #46

jphenow opened this issue Aug 29, 2012 · 0 comments

Comments

@jphenow
Copy link

jphenow commented Aug 29, 2012

After a fresh boot of the server:

$> curl -d client_id\=cf975811cbbcfc1ff3fc8afa04c8d8ac\&client_secret\=a4fff2a5a4557ac57f8953b2b8c79f46\&grant_type\=password\&username\=admin\&password\=test http://localhost:3002/oauth/token
<html><body>You are being <a href="http://localhost:3002/users/sign_in">redirected</a>.</body></html>

$> curl -d client_id\=cf975811cbbcfc1ff3fc8afa04c8d8ac\&client_secret\=a4fff2a5a4557ac57f8953b2b8c79f46\&grant_type\=password\&username\=admin\&password\=test http://localhost:3002/oauth/token
{"access_token":"f437ba79dacf57b23e70ef7c2475bc20","token_type":"bearer","expires_in":899,"refresh_token":"0cd05cdeadf642a8ed0b9677cf4e15ce"}

Can also reproduce by booting it then going to the authorize URL (in rails s output) will see:

Started GET "/oauth/authorize?response_type=code&client_id=cf975811cbbcfc1ff3fc8afa04c8d8ac&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fauth%2Fngin%2Fcallback" for 127.0.0.1 at 2012-08-29 16:18:21 -0500
Processing by Devise::Oauth2Providable::AuthorizationsController#new as HTML
  Parameters: {"response_type"=>"code", "client_id"=>"cf975811cbbcfc1ff3fc8afa04c8d8ac", "redirect_uri"=>"http://localhost:3000/users/auth/ngin/callback"}
Completed 401 Unauthorized in 6ms

Which will eventually succeed in loading the sign_in URL fine (no extra calls or anything)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant