Simulate ms ad login for Loadrunner performance testing

Venkat 26 Reputation points
2022-03-18T11:28:41.337+00:00

Hello,

First of all thanks to all the community for the content of this site.

We have a website using MS Azure AD SAML to authenticate all users. In order to automate the performance tests in the website, we need to simulate the login into the Azure AD SAML to obtain a SAML Assertion ID to pass to our website. We followed the same authentication flow that we identified in our browser.

So far, we are following these steps:

GET to our local SP with a redirect to Azure Client ID (IdP = https://sts.windows.net/xxx-xxx ) to obtain the SAML Request.
From this point we get the following parameters that are used in the next step: SAMLRequest, SigAlg, Signature

This step is working as expected and we get all expected parameters.

GET to login.microsoftonline.com/clientID/saml2?SAMLRequest=XX&SigAlg=XX&Signature=XX
From this point we get the following parameters that are used in the next step: esctx, canary, ApiCanary, flowToken, originalRequest, hpgact, hpgid, hpgrequestid, x-ms-request-id, buid, ctx

This step is working as expected and we get all the expected parameters.

POST to login.microsoftonline.com/common/GetCredentialType?mkt=en-US
We made a POST using JSON format to pass, amount others, the flowToken, originalRequest and the username.

This step is working as expected and we get the expected response verifying that the user has password to continue with the login.

POST to login.microsoftonline.com/clientID/login
We made a POST using format application/x-www-form-urlencoded to pass, amount others, the flowToken, login, password, canary, hpgrequestid and ctx.

This step is working as expected and we get the expected response.

POST to login.microsoftonline.com/clientID/kmsi
We made a POST using format application/x-www-form-urlencoded to pass amount others the flowToken, canary, hpgrequestid and ctx.

This step is not working and we do not get the SAMLResponse to give it back to our IdP. (We get a 200 but in the response says that we are missing a parameter)

We verify many times that we are passing all the cookies and headers to every step (HTTP Request) in the Test Plan and so far we get the same responses and cookies as if we were in the browser.

Could you please tell us:

Is it possible to simulate this authentication flow using
Loadrunner?

If it is, are we calling all the right entry points to make a successful login or are we missing some?

We were searching for documentation about this authentication flow, but without success, so, is there any documentation about this topic and all the endpoints to be called?

Thanks a lot in advance.

Best regards,
Venkat

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.