如何加载需要身份验证的asp.net mvc应用程序?

时间:2021-03-23 03:38:03

I am trying to load test an asp.net 5 / mvc 6 app. The app requires authentication to login - specifically I am using Office365/AzureAD to authenticate users.

我正在尝试加载一个asp.net 5/ mvc 6应用程序的测试。这个应用程序需要身份验证才能登录——特别是我正在使用Office365/AzureAD对用户进行身份验证。

Using VS2015, I setup a Web Performance and Load Test Project. I added and recorded a web test via the IE Web Test Recorder add-in. However, it doesn't seem like the recorder records authorization information, thus everything fails during replay/load test.

使用VS2015,我建立了一个Web性能和负载测试项目。我通过IE web测试记录器插件添加并记录了一个web测试。但是,似乎记录器并没有记录授权信息,因此在重播/加载测试期间一切都失败了。

I don't see any obvious way to plug in authentication information. Am I missing something obvious?

我看不到任何明显的插入身份验证信息的方法。我漏掉了什么明显的东西吗?

There is a similar question, but it deals with Windows authentication. As this authentication for AzureAD, the tricks in that question do not work.

有一个类似的问题,但它涉及Windows身份验证。作为AzureAD的身份验证,该问题中的技巧不起作用。

1 个解决方案

#1


1  

I do not know the specific mechanism for your authentication needs. One possibility is to record the entire transaction (including the authentication) with a program such as Fiddler and work out the authentication process then duplicate that in Visual Studio.

我不知道您的认证需要的具体机制。一种可能是使用Fiddler这样的程序记录整个事务(包括身份验证),然后在Visual Studio中完成身份验证过程。

On one of my projects the mechanism required was simply to add a new header field to each request, its value being the username and password (plus a few other fixed characters) all encoded in base-64.

在我的一个项目中,需要的机制是为每个请求添加一个新的header字段,它的值是用户名和密码(加上其他一些固定字符),都是用base-64编码的。

#1


1  

I do not know the specific mechanism for your authentication needs. One possibility is to record the entire transaction (including the authentication) with a program such as Fiddler and work out the authentication process then duplicate that in Visual Studio.

我不知道您的认证需要的具体机制。一种可能是使用Fiddler这样的程序记录整个事务(包括身份验证),然后在Visual Studio中完成身份验证过程。

On one of my projects the mechanism required was simply to add a new header field to each request, its value being the username and password (plus a few other fixed characters) all encoded in base-64.

在我的一个项目中,需要的机制是为每个请求添加一个新的header字段,它的值是用户名和密码(加上其他一些固定字符),都是用base-64编码的。