Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

iRule to insert HTTP Basic Authorization to the server side connection

Thiyagu
Cirrus
Cirrus

Hi Team,

Good day. We are working on an iRule to insert http basic authorization for the session to the application servers.

The front end connection from the client to the LB will not have http basic authorization value. whereas on the connection from the LB to the application server we need to insert basic authorization value in the header.

Thanks,

Thiyagu

 

2 REPLIES 2

Thiyagu
Cirrus
Cirrus

Will the below irule work

when HTTP_REQUEST_RELEASE {
HTTP::header insert X-Common-Name "1234"
}

Hi Thiyagu,

The iRule below should do the trick for you.

when HTTP_REQUEST {
   set username "Aladdin"
   set password "open sesame"
   set credentials [b64encode "$username:$password"]
   
   HTTP::header insert "Authorization" "Basic $credentials"
}

Have fun,

     --Niels