AppCredentials 类
- java.
lang. Object - com.
microsoft. bot. connector. authentication. AppCredentials
- com.
实现
public abstract class AppCredentials
implements ServiceClientCredentials
用于身份验证和缓存的 AAD 凭据的基本抽象。
子类必须提供 #buildAuthenticator 的 impl
构造函数摘要
| 构造函数 | 说明 |
|---|---|
| AppCredentials(String withChannelAuthTenant) |
初始化 App |
| AppCredentials(String withChannelAuthTenant, String withOAuthScope) |
初始化 App |
方法摘要
| 修饰符和类型 | 方法和描述 |
|---|---|
| void |
applyCredentialsFilter(OkHttpClient.Builder clientBuilder)
将凭据应用于 HTTP 请求。 |
| protected abstract Authenticator |
buildAuthenticator()
返回子类提供的相应 Authenticator。 |
| java.lang.String |
getAppId()
获取此凭据的应用 ID。 |
| protected java.lang.String |
getAuthTenant()
获取此凭据的通道身份验证令牌租户。 |
| java.lang.String |
getChannelAuthTenant()
获取要用于通道身份验证的租户。 |
| java.util.concurrent.CompletableFuture<java.lang.String> |
getToken()
获取 OAuth 访问令牌。 |
| java.lang.String |
oAuthEndpoint()
要使用的 OAuth 终结点。 |
| java.lang.String |
oAuthScope()
要使用的 OAuth 范围。 |
| void |
setAppId(String withAppId)
设置此凭据的Microsoft应用 ID。 |
| protected void |
setAuthTenant(String withAuthTenant)
设置此凭据的通道身份验证令牌租户。 |
| void |
setChannelAuthTenant(String withAuthTenant)
设置要用于通道身份验证的租户。 |
方法继承自 java.lang.Object
构造函数详细信息
AppCredentials
public AppCredentials(String withChannelAuthTenant)
初始化 AppCredentials 类的新实例。
参数:
AppCredentials
public AppCredentials(String withChannelAuthTenant, String withOAuthScope)
初始化 AppCredentials 类的新实例。
参数:
方法详细信息
applyCredentialsFilter
public void applyCredentialsFilter(OkHttpClient.Builder clientBuilder)
将凭据应用于 HTTP 请求。
注意:提供与 dotnet ProcessHttpRequestAsync 相同的功能
参数:
buildAuthenticator
protected abstract Authenticator buildAuthenticator()
返回子类提供的相应 Authenticator。
返回:
引发:
getAppId
public String getAppId()
获取此凭据的应用 ID。
返回:
getAuthTenant
protected String getAuthTenant()
获取此凭据的通道身份验证令牌租户。
返回:
getChannelAuthTenant
public String getChannelAuthTenant()
获取要用于通道身份验证的租户。
返回:
getToken
public CompletableFuture
获取 OAuth 访问令牌。
返回:
oAuthEndpoint
public String oAuthEndpoint()
要使用的 OAuth 终结点。
返回:
oAuthScope
public String oAuthScope()
要使用的 OAuth 范围。
返回:
setAppId
public void setAppId(String withAppId)
设置此凭据的Microsoft应用 ID。
参数:
setAuthTenant
protected void setAuthTenant(String withAuthTenant)
设置此凭据的通道身份验证令牌租户。
参数:
setChannelAuthTenant
public void setChannelAuthTenant(String withAuthTenant)
设置要用于通道身份验证的租户。
参数: