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.

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
エキスパート
回答済み 1年前
profile picture
エキスパート
レビュー済み 1年前
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
回答済み 1年前
  • Sorry, I am not aware of the existence of the cognito-user-pools.json file. Can you provide more information please?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ