I have a corporate OAuth 2.0 API that every application should use to authenticate its users. This API requires a request to have the following parameyers:
- response_type : must be set to “token”
- client_id : client identifier for the application
- redirect_uri : URI for the callback
state : a random value used by the client to maintain state between the request and callback
If the user is not authenticated, the standard corporate login page is displayed to enter user name and password.
If the user is authenticated after submitting the his user name and password, he is redirected to the client callback URL with an API generated token:
*HTTP 302 Redirect*
What is the way to go to connect a Rails app to this API ? Should I the use the Devise gem for that ? Any other solutions ?