This does not answer the question, but provides relevant information.
I had a problem when the gatekeeper checked any combination of users and passwords in a Grant Credentials Credentials Credentials request after having made some prior permission for a valid user / password combination. The script was:
- client receives authorization using a valid username and password
- the client resets / forgets the authorization token to terminate authorization
- the client can obtain a new permission using any username and password, authorizing for the original user.
It turned out to be Warden who kept the authorized user in the session, and my iOS client happily supported the session for me.
I decided this after the authorities immediately logged out after authentication. This works because, on an authorized request, OAuth gets the current user stored using the authorization token. It should not have a user in the session.
The following are config / initializers / doorkeeper.rb files. The last two lines come out after authorization.
# called for Resource Owner Password Credentials Grant resource_owner_from_credentials do request.params[:user] = {:email => request.params[:username], :password => request.params[:password]} request.env["devise.allow_params_authentication"] = true user = request.env["warden"].authenticate!(:scope => :user) env['warden'].logout user end
source share