cancel
Showing results for 
Search instead for 
Did you mean: 

I want to append RelayState parameter after the http payload and send the request to server

PratikMagar
Nimbostratus
Nimbostratus

I want to append RelayState parameter after the http payload and send the request to server.

Need help with iRule to achieve this.

 

https://10.x.x.x/adfs/ls/SAMLResponse=<XYZ>

 

I want to add this parameter "&RelayState=RPID%3Dnehrliferaydevsp" after the payload

 

https://10.x.x.x/adfs/ls/SAMLResponse=<XYZ>&RelayState=RPID%3Dliferaydevsp

2 REPLIES 2

xuwen
Cirrostratus
Cirrostratus

you should use HTTP::uri to set new uri, here are the link:

https://clouddocs.f5.com/api/irules/HTTP__uri.html

 

iRules code:

when HTTP_REQUEST {

if { [HTTP::uri] starts_with "/adfs/ls/SAMLResponse=<XYZ>" } {

set uri [HTTP::uri]

HTTP::uri [append uri "&RelayState=RPID%3Dliferaydevsp"]

}

}

 

I`m able to see its appending "&RelayState=RPID%3Dliferaydevsp" before "&SAMLResponse=ENCRYPTEDBODY"

 

But is it possible to append after the SAML body?

Like below,

"&SAMLResponse=ENCRYPTEDBODY&RelayState=RPID%3Dlifedevsp"

 

 This is what we have currently->

 

when HTTP_REQUEST {

 

if { [HTTP::uri] starts_with "/adfs/ls/" } {

 

set uri [HTTP::uri]

 

HTTP::uri [append uri "&RelayState=RPID%3Dlifedevsp"]

 

}

 

}