> **Experimental**
>
> `@aws-cdk/aws-amplify-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# BasicAuth

Basic Auth configuration.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/basic-auth.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-amplify-alpha/lib/basic-auth.ts#L54)

## Example

```ts
const amplifyApp = new amplify.App(this, 'MyApp', {
  sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
    owner: '<user>',
    repository: '<repo>',
    oauthToken: SecretValue.secretsManager('my-github-token'),
  }),
  basicAuth: amplify.BasicAuth.fromGeneratedPassword('username'),
});
```

## Initializer

```ts
new BasicAuth(props: BasicAuthProps)
```

## Methods

- `bind(scope: Construct, id: string): BasicAuthConfig` — Binds this Basic Auth configuration to an App.

- `fromCredentials(username: string, password: SecretValue): BasicAuth // chainable` (static) — Creates a Basic Auth configuration from a username and a password.

  **Parameters**

  - `username` — The username.
  - `password` — The password.

- `fromGeneratedPassword(username: string, encryptionKey?: IKey): BasicAuth // chainable` (static) — Creates a Basic Auth configuration with a password generated in Secrets Manager.

  **Parameters**

  - `username` — The username.
  - `encryptionKey` — The encryption key to use to encrypt the password in Secrets Manager.
