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: 
you can use this

<https://pub.dev/packages/auto_direction>

This package changes the direction of a widget from ltr direction into rtl direction and vice versa based on the language of the text provided.
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()

```