Hello,
Please find below a small irule to get a session cookie from another App1 (protected by APM) and play Basic SSO to the App2. I keep a APM profile on App2, in case that the first connection come here.
when HTTP_REQUEST {
set apm_cookie [HTTP::cookie value MRHSession]
if { [ACCESS::session exists -state_allow -sid $apm_cookie] } {
ACCESS::disable
set username [ACCESS::session data get -sid $apm_cookie session.logon.last.username]
set password [ACCESS::session data get -sid $apm_cookie -secure session.sso.custom.password]
set basic $username:$password
HTTP::header insert Authorization "Basic [b64encode $basic]"
}
}
You should not take this irule as-is because you probably need to add speicific actions. You can also define a variable at the begining of your VPE and add a condition that allow the session without any further processing if the variable is filled. Thus, you just need to replace few lines of code by :
ACCESS:session data set session.logon.last.custom.sso 1