AppCredentials Classe

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

Implementazioni

public abstract class AppCredentials
implements ServiceClientCredentials

Astrazione di base per le credenziali di AAD per l'autenticazione e la memorizzazione nella cache.

Le sottoclassi devono fornire l'impl per #buildAuthenticator

Riepilogo dei costruttori

Costruttore Descrizione
AppCredentials(String withChannelAuthTenant)

Inizializza una nuova istanza della classe AppCredentials.

AppCredentials(String withChannelAuthTenant, String withOAuthScope)

Inizializza una nuova istanza della classe AppCredentials.

Riepilogo dei metodi

Modificatore e tipo Metodo e descrizione
void applyCredentialsFilter(OkHttpClient.Builder clientBuilder)

Applicare le credenziali alla richiesta HTTP.

protected abstract Authenticator buildAuthenticator()

Restituisce un authenticator appropriato fornito da una sottoclasse.

java.lang.String getAppId()

Ottiene l'ID app per questa credenziale.

protected java.lang.String getAuthTenant()

Ottiene il tenant del token di autenticazione del canale per questa credenziale.

java.lang.String getChannelAuthTenant()

Ottiene il tenant da usare per l'autenticazione del canale.

java.util.concurrent.CompletableFuture<java.lang.String> getToken()

Ottiene un token di accesso OAuth.

java.lang.String oAuthEndpoint()

Endpoint OAuth da usare.

java.lang.String oAuthScope()

Ambito OAuth da usare.

void setAppId(String withAppId)

Imposta l'ID app Microsoft per questa credenziale.

protected void setAuthTenant(String withAuthTenant)

Imposta il tenant del token di autenticazione del canale per questa credenziale.

void setChannelAuthTenant(String withAuthTenant)

Imposta il tenant da usare per l'autenticazione del canale.

Metodi ereditati da 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

Dettagli costruttore

AppCredentials

public AppCredentials(String withChannelAuthTenant)

Inizializza una nuova istanza della classe AppCredentials.

Parametri:

withChannelAuthTenant - Opzionale. Tenant del token oauth.

AppCredentials

public AppCredentials(String withChannelAuthTenant, String withOAuthScope)

Inizializza una nuova istanza della classe AppCredentials.

Parametri:

withChannelAuthTenant - Opzionale. Tenant del token oauth.
withOAuthScope - Ambito del token.

Dettagli metodo

applyCredentialsFilter

public void applyCredentialsFilter(OkHttpClient.Builder clientBuilder)

Applicare le credenziali alla richiesta HTTP.

Nota: fornisce la stessa funzionalità di dotnet ProcessHttpRequestAsync

Parametri:

clientBuilder - generatore per la creazione di un OkHttpClient

buildAuthenticator

protected abstract Authenticator buildAuthenticator()

Restituisce un authenticator appropriato fornito da una sottoclasse.

Restituisce:

Oggetto Authenticator.

Genera un'eccezione:

java.net.MalformedURLException - Se l'endpoint non è valido.

getAppId

public String getAppId()

Ottiene l'ID app per questa credenziale.

Restituisce:

ID app.

getAuthTenant

protected String getAuthTenant()

Ottiene il tenant del token di autenticazione del canale per questa credenziale.

Restituisce:

Tenant del token di autenticazione del canale.

getChannelAuthTenant

public String getChannelAuthTenant()

Ottiene il tenant da usare per l'autenticazione del canale.

Restituisce:

Tenant da usare per l'autenticazione del canale.

getToken

public CompletableFuture getToken()

Ottiene un token di accesso OAuth.

Restituisce:

Se l'attività ha esito positivo, il risultato contiene la stringa del token di accesso.

oAuthEndpoint

public String oAuthEndpoint()

Endpoint OAuth da usare.

Restituisce:

Endpoint OAuth.

oAuthScope

public String oAuthScope()

Ambito OAuth da usare.

Restituisce:

Ambito OAuth.

setAppId

public void setAppId(String withAppId)

Imposta l'ID app Microsoft per questa credenziale.

Parametri:

withAppId - ID app.

setAuthTenant

protected void setAuthTenant(String withAuthTenant)

Imposta il tenant del token di autenticazione del canale per questa credenziale.

Parametri:

withAuthTenant - Tenant del token di autenticazione.

setChannelAuthTenant

public void setChannelAuthTenant(String withAuthTenant)

Imposta il tenant da usare per l'autenticazione del canale.

Parametri:

withAuthTenant - Tenant da usare per l'autenticazione del canale.

Si applica a