# Class: AbstractCredentialProvider

## Constructor

#### new AbstractCredentialProvider()

  Abstract class used to provide credentials for various types of authentication.

## Methods

#### 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.

  ##### Returns:

  { void }

### Callbacks

#### addOnInvalidCredentialsCallback(callback) → {void}

  Adds callback on invalidCredentialsProvided.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Config.AbstractCredentialProvider#onInvalidCredentialsProvided |

  ##### Returns:

  { void }

#### removeOnInvalidCredentialsCallback(callback) → {void}

  Removes callback from invalidCredentialsProvided.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Config.AbstractCredentialProvider#onInvalidCredentialsProvided |

  ##### Returns:

  { void }

## Type Definitions

#### onInvalidCredentialsProvided(invalidCredentialsEvent) → {void}

  Interface for callback function to be invoked when provided credentials are invalid.
  Any instance of this class will receive an event with methods to
  retry or cancel the connection attempt together with a number of previous
  attempts to re-connect.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `invalidCredentialsEvent` | AvayaClientServices.Config.InvalidCredentialsEvent | Event containing retry and cancel methods, and failure count.

  ##### See:

    - AvayaClientServices.Config.CredentialProvider#onInvalidCredentialsProvided
    - AvayaClientServices.Config.CredentialTokenProvider#onInvalidCredentialsProvided
    - AvayaClientServices.Config.GuestCredentialProvider#onInvalidCredentialsProvided
    - AvayaClientServices.Config.WCSCredentialTokenProvider#onInvalidCredentialsProvided

  ##### Returns:

  { void }