Salta al contenuto

Custom invitation code during registration

0

Hello everyone,

in the cognito console I created a custom attribute in the registration register. The purpose would be that if someone is creating an account on my website, he needs additionally an invitation code to be allowed to create an account. But after I created the custom attribute I wanted to let it show in the host UI, but it doesn't appear. Do I need to activate it somehow or is there any way possible to implement my idea.

I'd be glad if someone could clarify and thanks in advance!

posta 2 mesi fa38 visualizzazioni
1 Risposta
0

To implement an invitation code requirement during registration in Amazon Cognito, there are a few important considerations:

  1. Custom attributes you create in your user pool won't automatically appear in the hosted UI. The standard hosted UI only displays standard attributes and required attributes.

  2. For your invitation code implementation, you have a few options:

  • Use Lambda triggers: You can implement a pre sign-up Lambda trigger that validates the invitation code before allowing the user to complete registration. This would require custom code to verify the invitation code against your valid codes.

  • Use the newer Managed Login feature: Amazon Cognito's Managed Login offers more customization options than the classic Hosted UI, including support for choice-based authentication flows.

  • Create a custom UI: Instead of using the hosted UI, you could build your own registration interface that includes the invitation code field, then use the Amazon Cognito SDK to handle the registration process.

  1. If you're using custom attributes, remember that:
  • You need to set read and write permissions for your custom attributes in your app client settings
  • Immutable custom attributes can only be set during user creation
  • Custom attributes require the "custom:" prefix when referenced in code

Amazon Cognito is designed to be customizable for authentication flows, including registration. The SDK is available in multiple programming languages (Java, C++, PHP, Python, Golang, Ruby, .NET, and JavaScript), giving you flexibility in how you implement your invitation code requirement.
Sources
Configuring policies for user creation - Amazon Cognito
Working with user attributes - Amazon Cognito
Hosted UI and overall user experience | AWS re:Post
Features | Amazon Cognito | Amazon Web Services (AWS)

con risposta 2 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.