V_B
V_B

Reputation: 1569

How to remove Azure AD MFA for end to end functional automation test

We have an application protected under Azure AD custom app, using MSAL Library in .NET core MVC web application.
Now we want to automate functional test using Azure CICD pipeline. When we try to run this automation there is one blocker with MFA where we need to approve manually.

Can I avoid this MFA? I don't want to update conditional access policy as security team already rejected that approach.

Is there a way I can generate the token using secret and then login in to the browser? How can I bypass the login?

Upvotes: 1

Views: 2075

Answers (2)

V_B
V_B

Reputation: 1569

Mocking authentication is too much work. We use Azure Key Vault to save user credentials and dynamically get data from Key vault in the pipeline. This is a secure way to use credentials.

Upvotes: 1

AlfredoRevilla-MSFT
AlfredoRevilla-MSFT

Reputation: 3505

You cannot bypass MFA unless you mock authentication and authorization which is pretty doable in .NET Core. If you go the selenium route then take a look to How to resolve Multi Factor authentication for AAD in Selenium test in CI, it might help.

Upvotes: 1

Related Questions