Skip to content

Commit 23575cd

Browse files
authored
Update index.mdx
1 parent a432cb3 commit 23575cd

File tree

1 file changed

+0
-24
lines changed
  • src/pages/[platform]/build-a-backend/auth/connect-your-frontend/switching-authentication-flows

1 file changed

+0
-24
lines changed

src/pages/[platform]/build-a-backend/auth/connect-your-frontend/switching-authentication-flows/index.mdx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,30 +102,6 @@ func signIn(username: String, password: String) async throws {
102102
}
103103
```
104104

105-
### Set up auth backend
106-
107-
In order to use the authentication flow `USER_PASSWORD_AUTH`, your Cognito app client has to be configured to allow it. Amplify Gen 2 enables SRP auth by default. To enable USER_PASSWORD_AUTH, you can update the `backend.ts` file with the following changes:
108-
109-
```ts title="amplify/backend.ts"
110-
import { defineBackend } from '@aws-amplify/backend'
111-
import { auth } from './auth/resource'
112-
import { data } from './data/resource'
113-
114-
const backend = defineBackend({
115-
auth,
116-
data,
117-
});
118-
119-
// highlight-start
120-
backend.auth.resources.cfnResources.cfnUserPoolClient.explicitAuthFlows = [
121-
"ALLOW_USER_PASSWORD_AUTH",
122-
"ALLOW_USER_SRP_AUTH",
123-
"ALLOW_USER_AUTH",
124-
"ALLOW_REFRESH_TOKEN_AUTH"
125-
];
126-
// highlight-end
127-
```
128-
129105
### Migrate users with Amazon Cognito
130106

131107
Amazon Cognito provides a trigger to migrate users from your existing user directory seamlessly into Cognito. You achieve this by configuring your User Pool's "Migration" trigger which invokes a Lambda function whenever a user that does not already exist in the user pool authenticates, or resets their password.

0 commit comments

Comments
 (0)