aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.33k stars 247 forks source link

Email Address Input in Amplify Authentication is not Case Sensitive #4212

Open Transparent-Prophet opened 11 months ago

Transparent-Prophet commented 11 months ago

Description

The title pretty much explains it. Any uppercase characters are ignored in the built in text field so long as the overall email address exists. It's not exactly a major issue but it can be an inconvenience since most authenticators DO keep in mind case sensitivity for extra validation and potential security.

You also might want to check if this is the case for other Auth configurations like usernames-based sign in.

Categories

Steps to Reproduce

No response

Screenshots

No response

Platforms

Flutter Version

3.16.1

Amplify Flutter Version

12.8.2

Deployment Method

Amplify CLI

Schema

No response

Jordan-Nelson commented 6 months ago

Apologies for the delay in response. We are tracking this as a feature request and will post here when we have further updates.

jamontesg commented 1 week ago

Hi. any news about this ? @Jordan-Nelson it is possible force email to lowerCase ?

Equartey commented 1 week ago

Hi @jamontesg, the Authenticator currently transforms email input as lowercase internally. This feature request would be to allow for case sensitive input.

There are no updates at this time regarding enabling this behavior.

jamontesg commented 1 week ago

Hi @Equartey , Authenticator. don't apply any lower case function. I am using amplify_authenticator: 2.3.0 and android emulator

my code: AuthenticatorForm( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Column( children: [ const Image( image: AssetImage('assets/images/logos10.png')), Padding( padding: const EdgeInsets.all(15.0), child: Text( AppLocalizations.of(context)! .company_name_register, textAlign: TextAlign.center, style: Theme.of(context).textTheme.titleLarge), ), SignUpFormField.custom( required: true, validator: ((value) { if (value == null || value.isEmpty) { return AppLocalizations.of(context)! .name_empty .capitalized; } return null; }), title: AppLocalizations.of(context)!.name.capitalized, attributeKey: CognitoUserAttributeKey.name, ), DropdownButtonFormField( decoration: InputDecoration( hintText: AppLocalizations.of(context)! .country .capitalized, ), validator: (value) => value == null ? AppLocalizations.of(context)! .country .capitalized : null, onChanged: (String? newValue) { setState(() { selectedValue = newValue!; state.zoneInfo = newValue; }); }, items: dropdownItems), SignUpFormField.custom( required: true, validator: ((value) { if (value == null || value.isEmpty) { return AppLocalizations.of(context)! .farm_empty .capitalized; } return null; }), title: AppLocalizations.of(context)!.far_name.capitalized, attributeKey: CognitoUserAttributeKey.nickname, ), SignUpFormField.email(required: true), SignUpFormField.password(), SignUpFormField.passwordConfirmation(), const SignUpButton(), ], ), ), ),

Thanks for your time

Equartey commented 1 week ago

Hi @jamontesg, I'm not sure I understand the issue. Are you expecting the UI to transform the text input to lowercase? If so, you are correct; The authenticator does not offer that. However, internally we transform the input into lowercase and use that value to fulfill the request.

If I'm right in assuming you want the UI to change to display lowercase text input, that would be a separate feature request, unrelated to this one.

jamontesg commented 1 week ago

thanks @Equartey , mi users are typing. emails. like. Xaaaa@a.com. and. this ugly email with lower and upper case, is. stored into cognito users pool. I am trying to keep my information clean. Any ideas for get emails in lowercase using Authenticator ?

Equartey commented 1 week ago

@jamontesg, could you please create a separate feature request so we can track it independently from this one?

jamontesg commented 1 week ago

redada @Equartey https://github.com/aws-amplify/amplify-flutter/issues/5678

NikaHsn commented 4 days ago

@jamontesg thanks for creating the new feature request #5678.