Cognito user authentication

636 Views Asked by At

I have an application that used the Cognito user pool for authentication and authorization. I want the admin to login into the system without going through email verification. but all end users must go through the passwordless sign-up sign-in process.

my question is can I use the same user pool to implement both use cases or do I need to use separate user pools for admins and end-users?? I also would like to know whether it's possible to use same login endpoint for both admins and end-users

Thanks in advance!!!

1

There are 1 best solutions below

0
On

You should really include a code sample and what you've tried so far, but I had to work with Cognito recently so I think I can give an answer anyways.

If you're creating both users via AdminCreateUser, you would use this payload to create a verified email for the user. Keep in mind, having a verified email is separate from having a confirmed account. You can call this admin endpoint to confirm users: (https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/admin-confirm-sign-up.html).

UserAttributes: [
          {
            Name: 'email',
            Value: email
          },
          {
            Name: 'email_verified',
            Value: 'true'
          },
]