# AuthFlow

Types of authentication flow.

- Source: [`aws-cognito/lib/user-pool-client.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-client.ts#L22)
- Type last changed: v2.172.0 · 7 Dec 2024

## Example

```ts
const userPool = new cognito.UserPool(this, 'myuserpool', {
  signInPolicy: {
    allowedFirstAuthFactors: {
      password: true, // password authentication must be enabled
      emailOtp: true, // enables email message one-time password
      smsOtp: true,   // enables SMS message one-time password
      passkey: true,  // enables passkey sign-in
    },
  },
});

// You should also configure the user pool client with USER_AUTH authentication flow allowed
userPool.addClient('myclient', {
  authFlows: { user: true },
});
```

## Properties

- `adminUserPassword`: boolean = false — Enable admin based user password authentication flow.

- `custom`: boolean = false — Enable custom authentication flow.

- `user`: boolean = false — Enable Choice-based authentication.

- `userPassword`: boolean = false — Enable auth using username & password.

- `userSrp`: boolean = false — Enable SRP based authentication.
