Question: I want to create an AWS IAMS account that has various permissions with CloudFormation.

I understand there are policies that would let a user change his password and let him get his account to use MFA [here](https://security.stackexchange.com/questions/124786/aws-cloudformation-enable-mfa?newreg=9d07e7c9d733438b82b483b8a6afe541)

How could I enforce the user to use MFA at first log in time when he needs to change the default password?

This is what I have:

The flow I have so far is:

1. User account is created
2. When user tries to log in for the first time is asked to change the default password.
3. User is logged in the AWS console.

Expected behavior:

1. User account is created
2. When user tries to log in for the first time is asked to change the default password and set MFA using Authenticator app.
3. User is logged in the AWS console and has permissions.

A potential flow is shown [here](https://pomeroy.me/2020/09/solved-first-time-login-problems-when-enforcing-mfa-with-aws/). Is there another way?

Update:

This [blog](https://aws.amazon.com/blogs/security/how-to-delegate-management-of-multi-factor-authentication-to-aws-iam-users/) explains the flow
Again, is there a better way? Like an automatic pop up that would enforce the user straight away?

Update2:

I might have not been explicit enough.
What we have so far it is an ok customer experience.
This flow would be fluid

1. User tries to log in
2. Console asks for password change
3. Colsole asks for scanning the code and introducing the codes
4. User logs in with new password and the code from authenticator
5.User is not able to deactivate MFA

Answer: 
From [official documentation](https://flutter.dev/docs/development/accessibility-and-localization/internationalization)

By default, Flutter only provides US English localizations. To add support for other languages, an application must specify additional MaterialApp (or CupertinoApp) properties, and include a package called flutter\_localizations. As of November 2020, this package supports 78 languages.

To use flutter\_localizations, add the package as a dependency to your pubspec.yaml file:

```
    dependencies:
  flutter:
    sdk: flutter
  flutter_localizations: # Add this line
    sdk: flutter         # Add this line

```

Next, run pub get packages, then import the flutter\_localizations library and specify localizationsDelegates and supportedLocales for MaterialApp:

```
    import 'package:flutter_localizations/flutter_localizations.dart';
// TODO: uncomment the line below after codegen
// import 'package:flutter_gen/gen_l10n/app_localizations.dart';

// ...

MaterialApp(
 localizationsDelegates: [
   // ... app-specific localization delegate[s] here
   // TODO: uncomment the line below after codegen
   // AppLocalizations.delegate,
   GlobalMaterialLocalizations.delegate,
   GlobalWidgetsLocalizations.delegate,
   GlobalCupertinoLocalizations.delegate,
 ],
 supportedLocales: [
    const Locale('en', ''), // English, no country code
    const Locale('ar', ''), // Arabic, no country code
    const Locale.fromSubtags(languageCode: 'zh'), // Chinese *See Advanced Locales below*
    // ... other locales the app supports
  ],
  // ...
)

```

After introducing the flutter\_localizations package and adding the code above, the Material and Cupertino packages should now be correctly localized in one of the 78 supported locales. Widgets should be adapted to the localized messages, `along with correct left-to-right and right-to-left layout`. Try switching the target platform’s locale to Arabic (ar) and notice that the messages should be localized and widgets are laid out with right-to-left layout in mind.
Try using langdetect (if you use tkinter)

```
from langdetect import detect
from tkinter import *
from tkinter.constants import *

arabictext = "مرحبا"

root = Tk()
text = Text(root)
lang = detect(arabictext)

if lang == "ar":
    text.tag_configure('tag-right', justify='right')
    text.insert('end', arabictext, 'tag-right')
    text.grid()

root.mainloop()

```