SimpleCredentialProvider Class

  • java.lang.Object
    • com.microsoft.bot.connector.authentication.SimpleCredentialProvider

Implements

public class SimpleCredentialProvider
implements CredentialProvider

A simple implementation of the CredentialProvider interface.

Constructor Summary

Constructor Description
SimpleCredentialProvider()

Initializes a new instance with empty credentials.

SimpleCredentialProvider(String withAppId, String withPassword)

Initializes a new instance with the provided credentials.

Method Summary

Modifier and Type Method and Description
java.lang.String getAppId()

Gets the app ID for this credential.

java.util.concurrent.CompletableFuture<java.lang.String> getAppPassword(String validateAppId)

Gets the app password for a given bot app ID.

java.lang.String getPassword()

Gets the app password for this credential.

java.util.concurrent.CompletableFuture<java.lang.Boolean> isAuthenticationDisabled()

Checks whether bot authentication is disabled.

java.util.concurrent.CompletableFuture<java.lang.Boolean> isValidAppId(String validateAppId)

Validates an app ID.

void setAppId(String witAppId)

Sets the app ID for this credential.

void setPassword(String withPassword)

Sets the app password for this credential.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SimpleCredentialProvider

public SimpleCredentialProvider()

Initializes a new instance with empty credentials.

SimpleCredentialProvider

public SimpleCredentialProvider(String withAppId, String withPassword)

Initializes a new instance with the provided credentials.

Parameters:

withAppId - The app ID.
withPassword - The app password.

Method Details

getAppId

public String getAppId()

Gets the app ID for this credential.

Returns:

The app id.

getAppPassword

public CompletableFuture getAppPassword(String validateAppId)

Gets the app password for a given bot app ID.

Parameters:

validateAppId - The ID of the app to get the password for.

Returns:

If the task is successful and the app ID is valid, the result contains the password; otherwise, null.

getPassword

public String getPassword()

Gets the app password for this credential.

Returns:

The password.

isAuthenticationDisabled

public CompletableFuture isAuthenticationDisabled()

Checks whether bot authentication is disabled.

Returns:

A task that represents the work queued to execute If the task is successful and bot authentication is disabled, the result is true; otherwise, false.

isValidAppId

public CompletableFuture isValidAppId(String validateAppId)

Validates an app ID.

Parameters:

validateAppId - The app ID to validate.

Returns:

If the task is successful, the result is true if appId is valid for the controller; otherwise, false.

setAppId

public void setAppId(String witAppId)

Sets the app ID for this credential.

Parameters:

witAppId - The app id.

setPassword

public void setPassword(String withPassword)

Sets the app password for this credential.

Parameters:

withPassword - The password.

Applies to