问题
I am trying to integrate Selenium tests to CI. The problem I am facing is all the users (even test user) is protected by Multi-factor authentication and when I will run test cases on the server with each login there will a prompt user for the Multi factor. We are running selenium test cases on SPA using adal-angular.js and adal.js How to resolve this issue? Is there any way to create a logical switch on API server or SPA to bypass the authentication prompt?
Thanks.
回答1:
You cannot do this directly. Frankly if you could, I would be very concerned about the security of MFA at all.
Having said that, there is probably a way to help move forward. An SMS Modem (i.e. https://www.diafaan.com/how-to/choose-gsm-modem/) you could register a SIM card with Test User and use the modem to parse the incoming MFA challenge.
Another alternative is to use 3rd pary messaging service (as Twilio) and register a dedicated incoming phone number. Then register that number with the MFA. Then use the Twilio API to parse the MFA challenge.
来源:https://stackoverflow.com/questions/48350590/how-to-resolve-multi-factor-authentication-for-aad-in-selenium-test-in-ci