BasicAuthenticationCredentials class
使用用户名和密码进行身份验证的简单 <xref:ServiceClientCredential>。
构造函数
| Basic |
创建新的 BasicAuthenticationCredentials 对象。 |
属性
| authorization |
授权方案。 默认值为“Basic”。 此处提供了有关授权方案的详细信息:https://developer.mozilla.org/docs/Web/HTTP/Authentication#authentication_schemes |
| password | 密码 |
| user |
用户名 |
方法
| sign |
使用身份验证标头对请求进行签名。 |
构造函数详细信息
BasicAuthenticationCredentials(string, string, string)
创建新的 BasicAuthenticationCredentials 对象。
new BasicAuthenticationCredentials(userName: string, password: string, authorizationScheme?: string)
参数
- userName
-
string
用户名。
- password
-
string
密码。
- authorizationScheme
-
string
授权方案。
属性详细信息
authorizationScheme
授权方案。 默认值为“Basic”。 此处提供了有关授权方案的详细信息:https://developer.mozilla.org/docs/Web/HTTP/Authentication#authentication_schemes
authorizationScheme: string
属性值
string
password
密码
password: string
属性值
string
userName
用户名
userName: string
属性值
string
方法详细信息
signRequest(WebResourceLike)
使用身份验证标头对请求进行签名。
function signRequest(webResource: WebResourceLike): Promise<WebResourceLike>
参数
- webResource
- WebResourceLike
要签名的 WebResourceLike。
返回
Promise<WebResourceLike>
已签名的请求对象。