Hi Andrew,
Thanks for your feedback. We do need to do some more work on the library around resource owner password grant types, both for authenticating and non-authenticating clients. I've actually double checked the relevant sections of the spec with the working group behind the spec and it is very much in the spirit of the spec for the authorization server to apply additional checks beyond just a matching password before issuing tokens. Here are a couple reasons:
Obtaining an access token and/or refresh token in exchange for user credentials is actually an elevation of privilege. How can you have more power than a password would give you? Well, with a token you can outlive a password. If the user authorizes an app by sharing their password with it, and later realizes that was a mistake and changes their password to revoke access, from the user's perspective that would seem sufficient. Yet with a refresh token a password change doesn't (necessarily) invalidate the token. So the app still has permission to access user data.
Another concern is simply brute force password attacks. After several failed attempts, even a correct password guess may be rejected due to an account lockout. But this may be scoped to specific clients. For example, one client that is attempting a brute force attack may be blocked while a trusted client still may obtain authorization.
These are just a couple reasons why an authorization server may apply additional checks prior to issuing tokens. However as I said, more work in this area is warranted so that the authorization server can make informed decisions as to whether to issue tokens for an incoming request. The client, for example, needn't create an authorization record before following the standard oauth2 flow. The flow is what is supposed to create that record automatically. Watch for more in the near future.
--
--
Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death your right to say it." - S. G. Tallentyre