简体   繁体   中英

Testing Azure Active Directory security locally?

this question has been asked before about 2 years : Link

is there any way or new feature to mock or test the AAD?

eg log in by specific email.

You can test APIs protected by Azure AD by getting tokens as apps and users. I wrote a whole article on the topic: https://joonasw.net/view/testing-azure-ad-protected-apis-part-3-automated-integration-tests .

Essentially you can use Client credentials flow to get application tokens and ROPC flow to get user tokens. Then you can test the API with those.

As for UI applications, there is no good approach that I am aware of. You can try to automate logins, but it's a bit likely that AAD will think it's not a human and starts blocking logins. The AAD team has said on multiple occasions that trying to automate those logins isn't something you should do.

You'd need an entirely different identity provider used in tests to allow UI testing properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM