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
preguntada hace un año379 visualizaciones
2 Respuestas
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
EXPERTO
respondido hace un año
profile picture
EXPERTO
revisado hace un año
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
respondido hace un año
  • Sorry, I am not aware of the existence of the cognito-user-pools.json file. Can you provide more information please?

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas