Class: GuestCredentialProvider

Constructor

new GuestCredentialProvider(displayName)

Class used to provide credentials for Guest authentication.

Parameters:
Name Type Argument Description
displayName string <optional>

Members

displayName :string

Guest display name

Type:
  • string

domain :string

Domain for this credential object.

Type:
  • string

isGuest :boolean

Flag to indicate whether this is a guest user.

Type:
  • boolean

password :string

Password to be used used for authentication.

Type:
  • string

username :string

Guest username to be used for authentication.

Type:
  • string

Methods

getDisplayName() → {string}

Returns guest display name.

Returns:
{ string }

onAuthenticationChallenge(challenge, callback) → {void}

Function called after credentials were required.

Parameters:
Name Type Description
challenge Object

It is not used right now.

callback function

Function to be called after credentials are retrieved.

Inherited From:
Returns:
{ void }

setDisplayName(guestName)

Sets guest display name.

Parameters:
Name Type Description
guestName string

New display name value.

Callbacks

addOnInvalidCredentialsCallback(callback) → {void}

Adds callback on invalidCredentialsProvided.

Parameters:
Name Type Description
callback AvayaClientServices.Config.GuestCredentialProvider#onInvalidCredentialsProvided
Inherited From:
Returns:
{ void }

removeOnInvalidCredentialsCallback(callback) → {void}

Removes callback from invalidCredentialsProvided.

Parameters:
Name Type Description
callback AvayaClientServices.Config.AbstractCredentialProvider#onInvalidCredentialsProvided
Inherited From:
Returns:
{ void }

Type Definitions

onInvalidCredentialsProvided(invalidCredentialsEvent) → {void}

Interface for callback function to be invoked when provided credentials are invalid.

Examples

Using callback to retry authentication using existing credentials provider:

credentialProvider.addOnInvalidCredentialsCallback(function (event) {
    // When consumer application keeps a reference to the credential
    // provider used to configure services, display name may be updated:
    handle.credentialProvider.setDisplayName('John Doe');

    // Signal to try to re-establish the connection:
    event.retry(handle.credentialProvider); // Optional argument could
                                            // be omitted only when using
                                            // the same reference as in
                                            // the user configuration.
});

Using callback to retry authentication using new credential provider:

credentialProvider.addOnInvalidCredentialsCallback(function (event) {
    // When there is no reference to existing credentials provider,
    // create a new one first. It is allowed to switch to different
    // kind of the provider.
    const credentialProvider = new AvayaClientServices.Config.GuestCredentialProvider(
        'Jane Doe',
    );

    // It is advised to set up a similar callback when using a new instance:
    credentialProvider.onInvalidCredentialsProvided(function (event) {
        console.error(event.getFailureCount());
    });

    // Signal to save new credentials and try to re-establish the connection:
    event.retry(credentialProvider);
});

Using callback to cancel authentication:

credentialProvider.addOnInvalidCredentialsCallback(function (event) {
    event.cancel();
});
Parameters:
Name Type Description
invalidCredentialsEvent AvayaClientServices.Config.InvalidCredentialsEvent

Event containing retry and cancel methods, and failure count.

Returns:
{ void }
©2016 Avaya Inc. All Rights Reserved.