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