diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-16 08:39:47 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-16 08:39:47 -0700 |
commit | 4fefd4dac5970d0a294dfe3278c70f5fdd8da08f (patch) | |
tree | e013a6cee423c1176dcaf17aa698cb861ebbea0f /src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements | |
parent | d553771d2730774921c0f778e797f033bd84085d (diff) | |
download | DotNetOpenAuth-4fefd4dac5970d0a294dfe3278c70f5fdd8da08f.zip DotNetOpenAuth-4fefd4dac5970d0a294dfe3278c70f5fdd8da08f.tar.gz DotNetOpenAuth-4fefd4dac5970d0a294dfe3278c70f5fdd8da08f.tar.bz2 |
Authorization server hosts may now provide canonical usernames for the resource owner given correct resource owner credentials.
Fixes #103
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs index 10d1463..7361fb9 100644 --- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs +++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs @@ -95,8 +95,11 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { var resourceOwnerPasswordCarrier = message as AccessTokenResourceOwnerPasswordCredentialsRequest; if (resourceOwnerPasswordCarrier != null) { try { - if (this.AuthorizationServer.IsResourceOwnerCredentialValid(resourceOwnerPasswordCarrier.UserName, resourceOwnerPasswordCarrier.Password, resourceOwnerPasswordCarrier)) { + string canonicalUserName; + if (this.AuthorizationServer.IsResourceOwnerCredentialValid(resourceOwnerPasswordCarrier.UserName, resourceOwnerPasswordCarrier.Password, resourceOwnerPasswordCarrier, out canonicalUserName)) { + ErrorUtilities.VerifyHost(!string.IsNullOrEmpty(canonicalUserName), "IsResourceOwnerCredentialValid did not initialize out parameter."); resourceOwnerPasswordCarrier.CredentialsValidated = true; + resourceOwnerPasswordCarrier.UserName = canonicalUserName; } else { Logger.OAuth.ErrorFormat( "Resource owner password credential for user \"{0}\" rejected by authorization server host.", |