@@ -30,9 +30,10 @@ public class SimpleAccessToken : IAccessToken
30
30
/// <summary>
31
31
/// Create a new access token from the given account and tenant id
32
32
/// </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>
34
34
/// <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 )
36
37
{
37
38
if ( account == null )
38
39
{
@@ -48,28 +49,42 @@ public SimpleAccessToken(AzureAccount account, string tenantId)
48
49
throw new ArgumentException ( Resources . TypeNotAccessToken ) ;
49
50
}
50
51
this . UserId = account . Id ;
51
- this . _tokenType = _defaultTokenType ;
52
+ this . _tokenType = tokenType ;
52
53
this . AccessToken = account . GetProperty ( AzureAccount . Property . AccessToken ) ;
53
54
this . TenantId = tenantId ;
54
55
}
56
+
57
+
58
+ /// <summary>
59
+ /// The access token to be applied to a request message
60
+ /// </summary>
55
61
public string AccessToken { get ; private set ; }
56
62
63
+ /// <summary>
64
+ /// Authorize a request using an authorization setter function.
65
+ /// </summary>
66
+ /// <param name="authTokenSetter">The authorization token setter function.</param>
57
67
public void AuthorizeRequest ( System . Action < string , string > authTokenSetter )
58
68
{
59
69
authTokenSetter ( _tokenType , AccessToken ) ;
60
70
}
61
71
72
+ /// <summary>
73
+ /// The login type for this token
74
+ /// </summary>
62
75
public LoginType LoginType
63
76
{
64
77
get { return LoginType . OrgId ; }
65
78
}
66
79
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 ; }
72
84
85
+ /// <summary>
86
+ /// The User Id associated with this token.
87
+ /// </summary>
73
88
public string UserId { get ; private set ; }
74
89
}
75
90
}
0 commit comments