Protractor-net and Azure AD

226 views Asked by At

I'm new to Protractor and am wanting to write C# tests that run against an Angular 8 application. The problem is, the application uses Azure AD for authentication and I don't know the correct approach to authenticate automatically when running the test. If I navigate to the application URL it redirects to the Microsoft login page for authentication but I can't seem to access this.

1

There are 1 answers

0
Sri Hari Krishna Yalamanchili On

You can use the libraries given by Microsoft to implement applications for authenticating to Azure.MSAL is one of the libreary whiich is best to use. If you want to use MSAL to acquire a token, you need to:

  1. Register an application in Azure AD.

  2. Add target API, and grant consent to select permissions.

  3. Generate a secret key.

Then you can get a token as Acquire a token and call Microsoft Graph API.

However, I think what you really want is to integrate AAD. You can easily enable AAD authentication for your .NET web application. It uses OWIN middleware.