Search code examples
wso2wso2-identity-server

WSO2 Identity server Session Data Key Retrieval for SAML Authentication


I'm working on the Jmeter Performance Testing of WSO2 Identity Server SAML Authentication based Web Appplication. I need to test the User Login & Logout of the Application. For That i'm using blazemeter for recording the user login and logout from browser. But all the session parameters are hardcoded as i have recorded. can anyone please help how to retrive the session data key dynamically so that i can pass the same session data key for the subsequent request. Attaching the sample application URL which i get after calling the application url

Application url : http://appname:port/contextname

Identity server URL : https://:/logincontext?sessionDataKey=c3a1070c-38a2-454a-b441-3f8b330e7ccf&relyingParty=http://192.168.8.189:8081/UserportalService/saml/metadata&tenantDomain=carbon.super&_=1679255911821 or do we have any API's to test the SAML Authentication process.


Solution

  • I tried the above with IS 6.1.0 for the following steps:

    Pre-requisite - Setup a sample application with the SAML Traditional Web Application.

    Performance Scenario:

    1. Navigate to the sample application home page, click Login
    2. Enter the business user credentials
    3. User is redirected to the sample application landing page

    After recording with blazemeter, I was able to run the test dynamically. Before loginContext, there should be a samlsso post request to the server. The session data key is available in the response url of one the redirects.:

    1. POST https://localhost:9443/samlsso - body should include the SAML Request
      • The [sessionDataKey] is available in the Response URL which can be retrieved using the regex extractor
    2. https://localhost:9443/loginContext
      • [sessionDataKey] taken from step 1 should be replaced here

    enter image description here