Forum Discussion
hooleylist
Feb 29, 2008Cirrostratus
I assume remote user is the base64 encoded value in the Authorization header. If so, you can use HTTP::header value Authorization to get the header value, decode it using b64decode and then split the value on the decoded colon:
set auth_value [HTTP::header value Authorization]
set decoded_auth_value [b64decode $auth_value]
set user [getfield $decoded_auth_field 1]
set pass [getfield $decoded_auth_field 2]
or:
set user [getfield [b64decode [HTTP::header value Authorization] 1]
set pass [getfield [b64decode [HTTP::header value Authorization] 2]
Most of the other CGI variables are available using various commands:
- client IP address and port: [IP::client_addr] and [TCP::client_port]
- VIP IP and port by using [IP::local_addr] and [TCP::local_port] in a client side event
- request method: [HTTP::method
- path: [HTTP::path]
- URI: [HTTP::uri]
- query string: [HTTP::query]
- content type: [HTTP::header value Content-Type]
- content length: [HTTP::header value Content-Length]
For details on the commands, you can check the corresponding wiki pages:
http://devcentral.f5.com/wiki/Default.aspx/iRules.HomePage (Click here)
Aaron