AppCredentials Class
- java.
lang. Object - com.
microsoft. bot. connector. authentication. AppCredentials
- com.
Implements
public abstract class AppCredentials
implements ServiceClientCredentials
Base abstraction for AAD credentials for auth and caching.
Subclasses must provide the impl for #buildAuthenticator
Constructor Summary
| Constructor | Description |
|---|---|
| AppCredentials(String withChannelAuthTenant) |
Initializes a new instance of the App |
| AppCredentials(String withChannelAuthTenant, String withOAuthScope) |
Initializes a new instance of the App |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
applyCredentialsFilter(OkHttpClient.Builder clientBuilder)
Apply the credentials to the HTTP request. |
| protected abstract Authenticator |
buildAuthenticator()
Returns an appropriate Authenticator that is provided by a subclass. |
| java.lang.String |
getAppId()
Gets the App ID for this credential. |
| protected java.lang.String |
getAuthTenant()
Gets the channel auth token tenant for this credential. |
| java.lang.String |
getChannelAuthTenant()
Gets tenant to be used for channel authentication. |
| java.util.concurrent.CompletableFuture<java.lang.String> |
getToken()
Gets an OAuth access token. |
| java.lang.String |
oAuthEndpoint()
OAuth endpoint to use. |
| java.lang.String |
oAuthScope()
OAuth scope to use. |
| void |
setAppId(String withAppId)
Sets the Microsoft app ID for this credential. |
| protected void |
setAuthTenant(String withAuthTenant)
Sets the channel auth token tenant for this credential. |
| void |
setChannelAuthTenant(String withAuthTenant)
Sets tenant to be used for channel authentication. |
Methods inherited from java.lang.Object
Constructor Details
AppCredentials
public AppCredentials(String withChannelAuthTenant)
Initializes a new instance of the AppCredentials class.
Parameters:
AppCredentials
public AppCredentials(String withChannelAuthTenant, String withOAuthScope)
Initializes a new instance of the AppCredentials class.
Parameters:
Method Details
applyCredentialsFilter
public void applyCredentialsFilter(OkHttpClient.Builder clientBuilder)
Apply the credentials to the HTTP request.
Note: Provides the same functionality as dotnet ProcessHttpRequestAsync
Parameters:
buildAuthenticator
protected abstract Authenticator buildAuthenticator()
Returns an appropriate Authenticator that is provided by a subclass.
Returns:
Throws:
getAppId
public String getAppId()
Gets the App ID for this credential.
Returns:
getAuthTenant
protected String getAuthTenant()
Gets the channel auth token tenant for this credential.
Returns:
getChannelAuthTenant
public String getChannelAuthTenant()
Gets tenant to be used for channel authentication.
Returns:
getToken
public CompletableFuture
Gets an OAuth access token.
Returns:
oAuthEndpoint
public String oAuthEndpoint()
OAuth endpoint to use.
Returns:
oAuthScope
public String oAuthScope()
OAuth scope to use.
Returns:
setAppId
public void setAppId(String withAppId)
Sets the Microsoft app ID for this credential.
Parameters:
setAuthTenant
protected void setAuthTenant(String withAuthTenant)
Sets the channel auth token tenant for this credential.
Parameters:
setChannelAuthTenant
public void setChannelAuthTenant(String withAuthTenant)
Sets tenant to be used for channel authentication.
Parameters: