summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResourceOwnerPasswordCredentialsRequest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResourceOwnerPasswordCredentialsRequest.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResourceOwnerPasswordCredentialsRequest.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResourceOwnerPasswordCredentialsRequest.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResourceOwnerPasswordCredentialsRequest.cs
index 52e65be..02859e1 100644
--- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResourceOwnerPasswordCredentialsRequest.cs
+++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AccessTokenResourceOwnerPasswordCredentialsRequest.cs
@@ -51,7 +51,7 @@ namespace DotNetOpenAuth.OAuth2.Messages {
/// Gets the name on the account whose data on the resource server is accessible using this authorization.
/// </summary>
string IAuthorizationDescription.User {
- get { return this.UserName; }
+ get { return this.RequestingUserName; }
}
/// <summary>
@@ -64,6 +64,16 @@ namespace DotNetOpenAuth.OAuth2.Messages {
#endregion
/// <summary>
+ /// Gets the username of the authorizing user, when applicable.
+ /// </summary>
+ /// <value>
+ /// A non-empty string; or <c>null</c> when no user has authorized this access token.
+ /// </value>
+ public override string UserName {
+ get { return base.UserName ?? this.RequestingUserName; }
+ }
+
+ /// <summary>
/// Gets the type of the grant.
/// </summary>
/// <value>The type of the grant.</value>
@@ -76,7 +86,7 @@ namespace DotNetOpenAuth.OAuth2.Messages {
/// </summary>
/// <value>The username on the user's account.</value>
[MessagePart(Protocol.username, IsRequired = true)]
- internal string UserName { get; set; }
+ internal string RequestingUserName { get; set; }
/// <summary>
/// Gets or sets the user's password.