Hi @Gongya Yu
Thank you for reaching us!
To answer your question, in Microsoft Entra id MFA is for user principals(users), NOT service principals
In your case if the python SDK depends on token grant flow types used. If the flow needs the user authentication you need to authenticate with user.
In instance MFA for client_credentials, On-Behalf-Of flow, in Entra ID is not possible currently
Hope this helps. Do let us know if you any further queries.
Thanks.
Akhilesh.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.