Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to login with otp code, customized flow #5787

Open
4 of 14 tasks
vkumarvs opened this issue Dec 23, 2024 · 2 comments
Open
4 of 14 tasks

How to login with otp code, customized flow #5787

vkumarvs opened this issue Dec 23, 2024 · 2 comments
Assignees
Labels
auth Issues related to the Auth Category question A question about the Amplify Flutter libraries

Comments

@vkumarvs
Copy link

vkumarvs commented Dec 23, 2024

Description

Hello everyone,
I would really appreciate if someone can help me out here.

Does amplify flutter auth package supports login with otp as well as password. I want to customize my frontend Auth UI screens, my flow is something like this:
signUp --- using email and password, by sending code to confirm the email.
signIn --> After email verification user can choose to either log in by sending OTP (no TOTP) or by entering password.

My login using password works fine. however I tried to find auth support to do with otp, I couldnt locate any way to do so (Amplify.Auth.).

Please point me out in right direction.

Debug:
I have enabled a managed UI that cognito provide, which helped to verify that my cognito configuration is correct. By using cognito provide link i can verify that my login using password, OTP or even passkeys works fine.

I am using below packages.

amplify_flutter: ^2.5.0
amplify_auth_cognito: ^2.5.0
amplify_authenticator: ^2.3.1
amplify_api: ^2.5.0
amplify_storage_s3: ^2.5.1

`const backend = defineBackend({
auth,
storage,
//data,
});

const { cfnResources } = backend.auth.resources;
const { cfnUserPool, cfnUserPoolClient } = cfnResources;
configureAuthOverrides();

/**

  • Configure Auth Overrides
    */
    function configureAuthOverrides() {
    // Update User Pool properties
    cfnUserPool.addPropertyOverride(
    'Policies.SignInPolicy.AllowedFirstAuthFactors',
    ['PASSWORD', 'WEB_AUTHN', 'EMAIL_OTP']
    );

cfnUserPool.addPropertyOverride('WebAuthnUserVerification', 'preferred');

// Update User Pool Client properties
cfnUserPoolClient.explicitAuthFlows = [
'ALLOW_REFRESH_TOKEN_AUTH',
'ALLOW_USER_AUTH',
'ALLOW_USER_SRP_AUTH',
];
...`

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

Customized screens using amplify.Auth provided functions and Autneticator.

Screenshots

Managed link login works fine

Screenshot 2024-12-23 at 10 03 33 PM

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.24.4

Amplify Flutter Version

amplify_flutter: ^2.5.0

Deployment Method

Amplify Gen 2

Schema

No response

@github-actions github-actions bot added pending-triage This issue is in the backlog of issues to triage pending-maintainer-response Pending response from a maintainer of this repository labels Dec 23, 2024
@ekjotmultani
Copy link
Member

Hello @vkumarvs, to be clear, you want to use web ui to allow a user to log in using just their email and a code sent to that email?

@ekjotmultani ekjotmultani self-assigned this Dec 24, 2024
@github-actions github-actions bot removed the pending-maintainer-response Pending response from a maintainer of this repository label Dec 24, 2024
@ekjotmultani ekjotmultani added question A question about the Amplify Flutter libraries pending-maintainer-response Pending response from a maintainer of this repository labels Dec 24, 2024
@github-actions github-actions bot removed the pending-triage This issue is in the backlog of issues to triage label Dec 24, 2024
@ekjotmultani ekjotmultani added the auth Issues related to the Auth Category label Dec 24, 2024
@vkumarvs
Copy link
Author

Hello @vkumarvs, to be clear, you want to use web ui to allow a user to log in using just their email and a code sent to that email?

Hi ekjotmultani,
Thank you for taking time, I refined the description a bit!

@ekjotmultani ekjotmultani removed the pending-maintainer-response Pending response from a maintainer of this repository label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues related to the Auth Category question A question about the Amplify Flutter libraries
Projects
None yet
Development

No branches or pull requests

2 participants