Skip to content

Commit 4e7a1f8

Browse files
committed
Responding to review feedback
1 parent 2321bdb commit 4e7a1f8

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

src/ResourceManager/Profile/Commands.Profile/Models/SimpleAccessToken.cs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ public class SimpleAccessToken : IAccessToken
3030
/// <summary>
3131
/// Create a new access token from the given account and tenant id
3232
/// </summary>
33-
/// <param name="account">The account, containign user id, access token information</param>
33+
/// <param name="account">The account, containing user id, access token information</param>
3434
/// <param name="tenantId">The tenant id for the given access token</param>
35-
public SimpleAccessToken(AzureAccount account, string tenantId)
35+
/// <param name="tokenType">The token type for the given token.</param>
36+
public SimpleAccessToken(AzureAccount account, string tenantId, string tokenType = _defaultTokenType)
3637
{
3738
if (account == null)
3839
{
@@ -48,28 +49,42 @@ public SimpleAccessToken(AzureAccount account, string tenantId)
4849
throw new ArgumentException(Resources.TypeNotAccessToken);
4950
}
5051
this.UserId = account.Id;
51-
this._tokenType = _defaultTokenType;
52+
this._tokenType = tokenType;
5253
this.AccessToken = account.GetProperty(AzureAccount.Property.AccessToken);
5354
this.TenantId = tenantId;
5455
}
56+
57+
58+
/// <summary>
59+
/// The access token to be applied to a request message
60+
/// </summary>
5561
public string AccessToken { get; private set; }
5662

63+
/// <summary>
64+
/// Authorize a request using an authorization setter function.
65+
/// </summary>
66+
/// <param name="authTokenSetter">The authorization token setter function.</param>
5767
public void AuthorizeRequest(System.Action<string, string> authTokenSetter)
5868
{
5969
authTokenSetter(_tokenType, AccessToken);
6070
}
6171

72+
/// <summary>
73+
/// The login type for this token
74+
/// </summary>
6275
public LoginType LoginType
6376
{
6477
get { return LoginType.OrgId; }
6578
}
6679

67-
public string TenantId
68-
{
69-
get;
70-
private set;
71-
}
80+
/// <summary>
81+
/// The tenant Id for this token.
82+
/// </summary>
83+
public string TenantId { get; private set; }
7284

85+
/// <summary>
86+
/// The User Id associated with this token.
87+
/// </summary>
7388
public string UserId { get; private set; }
7489
}
7590
}

0 commit comments

Comments
 (0)