restrict specific users using lambda function for registration and signin

0

i want to restrict a specific domain @abc.com so that other than @abc.com no one can login to my application can you please help, i have created cognito domain as login but now the issue is everyone can login using gmail, yahoo or any other domain.

akif
demandé il y a un an381 vues
2 réponses
0

Hi,

You can configure a Pre authentication Lambda trigger on Cognito to perform a custom validation and accept or deny the sign-in request.

On the other hand, if you want to limit the domain with which users can register in your application, you should use the Pre sign-up Lambda trigger, which allows performing a custom validation to accept or deny the registration request.

profile picture
EXPERT
répondu il y a un an
profile picture
EXPERT
vérifié il y a un an
0

Using a custom domain: If you have a custom domain configured for your user pool, you can add a list of allowed domains to the AllowedDomains attribute in the cognito-user-pools.json file. For example, the following code would allow users to sign in only if their email addresses end in @example.com or @mycompany.com:

"AllowedDomains": [ "example.com", "mycompany.com" ]

can you please help me find cognito-user-pools.json file, so that i can modify

akif
répondu il y a un an
  • Sorry, I am not aware of the existence of the cognito-user-pools.json file. Can you provide more information please?

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions