Hi @Keiichi Hikita • Thank you for reaching out.
If I understood you correctly, you are looking for a way to automate Multi-factor Authentication by configuring the application to auto-generate and submit the same security code/OTP as sent via Azure MFA.
If that is the case, there is no way to achieve this. As in general, for MFA to complete successfully, the below factors are considered:
- Something you know. Which is typically a password.
- Something you have. Which could be a mobile device or a registered hardware device token.
Optionally, based on the configuration, it may require you to provide evidence of
- Something you are. Like a fingerprint or some other biometric data.
Automation can be done for "Something you know" but not for "Something you have" or "Something you are" as these factors require human intervention.
The best you can do is, configure a conditional access policy to trigger MFA and exclude the test account/test application/IP address (if it is public IP) of the testing device from the conditional access policy to skip MFA. Unfortunately, when MFA is enforced, you cannot automate the authentication.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.