你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

UserTokenProvider.CreateCredentialsFromCache 方法

定义

重载

CreateCredentialsFromCache(String, String, String)

使用默认令牌缓存通过以前登录时缓存到 Azure 资源管理器的信息创建服务客户端凭据。 参数用于匹配现有令牌。

CreateCredentialsFromCache(String, String, String, TokenCache)

使用从以前登录 Azure 资源管理器中缓存的信息创建服务客户端凭据。 参数用于匹配现有令牌。

CreateCredentialsFromCache(String, String, String, ActiveDirectoryServiceSettings)

使用默认令牌缓存中以前登录名中缓存的信息创建服务客户端凭据。 参数用于匹配现有令牌。

CreateCredentialsFromCache(String, String, String, ActiveDirectoryServiceSettings, TokenCache)

使用以前登录名中缓存的信息创建服务客户端凭据。 参数用于匹配现有令牌。

CreateCredentialsFromCache(String, String, String)

使用默认令牌缓存通过以前登录时缓存到 Azure 资源管理器的信息创建服务客户端凭据。 参数用于匹配现有令牌。

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> CreateCredentialsFromCache (string clientId, string domain, string username);
static member CreateCredentialsFromCache : string * string * string -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function CreateCredentialsFromCache (clientId As String, domain As String, username As String) As Task(Of ServiceClientCredentials)

参数

clientId
String

检索身份验证令牌时要匹配的 clientId。

domain
String

检索身份验证令牌时要匹配的 Active Directory 域或租户 ID。

username
String

检索身份验证令牌时要匹配的帐户用户名。

返回

ServiceClientCredentials 对象,可用于使用检索到的凭据对 http 请求进行身份验证。 如果无法检索任何凭据,则会引发身份验证异常。

适用于

CreateCredentialsFromCache(String, String, String, TokenCache)

使用从以前登录 Azure 资源管理器中缓存的信息创建服务客户端凭据。 参数用于匹配现有令牌。

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> CreateCredentialsFromCache (string clientId, string domain, string username, Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache cache);
static member CreateCredentialsFromCache : string * string * string * Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function CreateCredentialsFromCache (clientId As String, domain As String, username As String, cache As TokenCache) As Task(Of ServiceClientCredentials)

参数

clientId
String

检索身份验证令牌时要匹配的 clientId。

domain
String

检索身份验证令牌时要匹配的 Active Directory 域或租户 ID。

username
String

检索身份验证令牌时要匹配的帐户用户名。

cache
Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache

检索令牌时要面向的令牌缓存。

返回

ServiceClientCredentials 对象,可用于使用检索到的凭据对 http 请求进行身份验证。 如果无法检索任何凭据,则会引发身份验证异常。

适用于

CreateCredentialsFromCache(String, String, String, ActiveDirectoryServiceSettings)

使用默认令牌缓存中以前登录名中缓存的信息创建服务客户端凭据。 参数用于匹配现有令牌。

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> CreateCredentialsFromCache (string clientId, string domain, string username, Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings serviceSettings);
static member CreateCredentialsFromCache : string * string * string * Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function CreateCredentialsFromCache (clientId As String, domain As String, username As String, serviceSettings As ActiveDirectoryServiceSettings) As Task(Of ServiceClientCredentials)

参数

clientId
String

检索身份验证令牌时要匹配的 clientId。

domain
String

检索身份验证令牌时要匹配的 Active Directory 域或租户 ID。

username
String

检索身份验证令牌时要匹配的帐户用户名。

serviceSettings
ActiveDirectoryServiceSettings

Active Directory 服务设置,包括检索令牌时要匹配的令牌颁发机构和受众。

返回

ServiceClientCredentials 对象,可用于使用检索到的凭据对 http 请求进行身份验证。 如果无法检索任何凭据,则会引发身份验证异常。

适用于

CreateCredentialsFromCache(String, String, String, ActiveDirectoryServiceSettings, TokenCache)

使用以前登录名中缓存的信息创建服务客户端凭据。 参数用于匹配现有令牌。

public static System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials> CreateCredentialsFromCache (string clientId, string domain, string username, Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings serviceSettings, Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache cache);
static member CreateCredentialsFromCache : string * string * string * Microsoft.Rest.Azure.Authentication.ActiveDirectoryServiceSettings * Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache -> System.Threading.Tasks.Task<Microsoft.Rest.ServiceClientCredentials>
Public Shared Function CreateCredentialsFromCache (clientId As String, domain As String, username As String, serviceSettings As ActiveDirectoryServiceSettings, cache As TokenCache) As Task(Of ServiceClientCredentials)

参数

clientId
String

检索身份验证令牌时要匹配的 clientId。

domain
String

检索身份验证令牌时要匹配的 Active Directory 域或租户 ID。

username
String

检索身份验证令牌时要匹配的帐户用户名。

serviceSettings
ActiveDirectoryServiceSettings

Active Directory 服务设置,包括检索令牌时要匹配的令牌颁发机构和受众。

cache
Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache

检索令牌时要面向的令牌缓存。

返回

ServiceClientCredentials 对象,可用于使用检索到的凭据对 http 请求进行身份验证。 如果无法检索任何凭据,则会引发身份验证异常。

适用于