diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-24 09:02:58 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-24 09:02:58 -0800 |
commit | 98f555915c230a8af154984fb7d29f58a5027acc (patch) | |
tree | d6303fe488eb02f2fe5d4eb5d0a4db7f8b4ec148 /src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationServer.cs | |
parent | b06334b3cd7fa616c5a53ced828b890c1380744a (diff) | |
download | DotNetOpenAuth-98f555915c230a8af154984fb7d29f58a5027acc.zip DotNetOpenAuth-98f555915c230a8af154984fb7d29f58a5027acc.tar.gz DotNetOpenAuth-98f555915c230a8af154984fb7d29f58a5027acc.tar.bz2 |
Adds support for the resource owner password credential grant.
Fixes #72
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationServer.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationServer.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationServer.cs b/src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationServer.cs index 1732003..8f4745f 100644 --- a/src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationServer.cs +++ b/src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationServer.cs @@ -113,6 +113,17 @@ namespace DotNetOpenAuth.OAuth2 { /// account or piece of hardware in which the tokens were stored. </para> /// </remarks> bool IsAuthorizationValid(IAuthorizationDescription authorization); + + /// <summary> + /// Determines whether a given set of resource owner credentials is valid based on the authorization server's user database. + /// </summary> + /// <param name="userName">Username on the account.</param> + /// <param name="password">The user's password.</param> + /// <returns> + /// <c>true</c> if the given credentials are valid; otherwise, <c>false</c>. + /// </returns> + /// <exception cref="NotSupportedException">May be thrown if the authorization server does not support the resource owner password credential grant type.</exception> + bool IsResourceOwnerCredentialValid(string userName, string password); } /// <summary> @@ -234,5 +245,20 @@ namespace DotNetOpenAuth.OAuth2 { Requires.NotNull(authorization, "authorization"); throw new NotImplementedException(); } + + /// <summary> + /// Determines whether a given set of resource owner credentials is valid based on the authorization server's user database. + /// </summary> + /// <param name="userName">Username on the account.</param> + /// <param name="password">The user's password.</param> + /// <returns> + /// <c>true</c> if the given credentials are valid; otherwise, <c>false</c>. + /// </returns> + /// <exception cref="NotSupportedException">May be thrown if the authorization server does not support the resource owner password credential grant type.</exception> + bool IAuthorizationServer.IsResourceOwnerCredentialValid(string userName, string password) { + Contract.Requires(!String.IsNullOrEmpty(userName)); + Contract.Requires(password != null); + throw new NotImplementedException(); + } } } |