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
질문됨 일 년 전381회 조회
2개 답변
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
전문가
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
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
답변함 일 년 전
  • Sorry, I am not aware of the existence of the cognito-user-pools.json file. Can you provide more information please?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠