variable from HTTP_REQUEST to ACCESS_POLICY_AGENT_EVENT

Hi,

I am trying grab username which is part of URI::Query(when HTTP_REQUEST) and trying to assign it to session.logon.last.username (when ACCESS_POLICY_AGENT_EVENT)

Is it possible to take a variable from event HTTP_REQUEST and assign it to a variable when ACCESS_POLICY_AGENT_EVENT ?

I am doing this as a part of Office 365 implementation.

Any help would be much appreciated.

Current iRule

when HTTP_REQUEST { if { [HTTP::uri] contains “username=”} { set uri [URI::decode [URI::query [HTTP::uri]]] set urisplit [split $uri “&”] set uname [lindex $urisplit 2] log local0. $uname }

}

when ACCESS_POLICY_AGENT_EVENT { if { [ACCESS::policy agent_id] eq “getusername” } { ACCESS::session data set session.temp.username $uname } }

I am assigning session.temp.username to session.logon.last.username using variable assignment

The bit that is not working is assignment of $uname to ACCESS::session data set session.temp.username

try

ACCESS::session data set session.custom.username $uname

Hi,

you can use

ACCESS_SESSION_STARTED

instead of

ACCESS_POLICY_AGENT_EVENT

and

HTTP_REQUEST
when ACCESS_SESSION_STARTED {

      if { [HTTP::uri] contains "username="}
    { 
      set uri [URI::decode [URI::query [HTTP::uri]]]
          set urisplit  [split $uri "&"]
          set uname [lindex $urisplit 2]
          log local0. $uname
          ACCESS::session data set session.temp.username $uname
        }

}