# Interface BaseCredentialService

Abstract class for Service that loads / saves tool credentials from / to the backend credential store.

interface BaseCredentialService {
loadCredential(
authConfig: AuthConfig,
toolContext: Context,
): Promise<AuthCredential | undefined>;
saveCredential(authConfig: AuthConfig, toolContext: Context): Promise<void>;
}

- Defined in auth/credential_service/base_credential_service.ts:15

## Methods

### loadCredential

- loadCredential(
  authConfig: AuthConfig,
  toolContext: Context,
  ): Promise<AuthCredential | undefined>

  Loads the credential by auth config and current tool context from the backend credential store.

  #### Parameters

  - authConfig: AuthConfig

    The auth config which contains the auth scheme and auth credential information. auth_config.get_credential_key will be used to build the key to load the credential.

  - toolContext: Context

    The context of the current invocation when the tool is trying to load the credential.

  #### Returns Promise<AuthCredential | undefined>

  A promise that resolves to the credential saved in the store.

  - Defined in auth/credential_service/base_credential_service.ts:27

### saveCredential

- saveCredential(authConfig: AuthConfig, toolContext: Context): Promise<void>

  #### Parameters

  - authConfig: AuthConfig
  - toolContext: Context

  #### Returns Promise<void>

  - Defined in auth/credential_service/base_credential_service.ts:43