Monday, June 20, 2016

Common Issue in JMeter Script with Single Sign on Applications

One of the common issue in single sign on application is Correlation of SAML Request and SAML Response.

When we capture the SAML Req/ SAML Response by using correlation.

We will get in the following format:

PHNhbWxwOkF1dGhuUmVxdWVzdCAgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1M
OjIuMDpwcm90b2NvbCIKSUQ9InMyNDEzMzFjNzk5MGVmMGZmZWRkMjJkYWQyNzdjMGYxNjdkMmE3


We need to replace the following and then pass to the next request.

 need to be replaced with %0D
+ need to be replaced with %2B

Following is the syntax we can use for replacing.

We can use JSR223 Processor - Groovy Language

def a =  ("${SAMLReq}".replaceAll('+'\,'%2B'));
def b =  (a.replaceAll('
'\,'%0D'));
//log.info("Final SAML Req : "+b );
vars.put ("SAML_Req",b);


No comments: