Convert an HTTP Header Response Attribute to Upper Case
search cancel

Convert an HTTP Header Response Attribute to Upper Case

book

Article ID: 5055

calendar_today

Updated On:

Products

CA Single Sign-On

Issue/Introduction

A WebAgent-HTTP-Header-Variable is configured to return a user attribute from an LDAP user store.  There is an application which is looking for the value in the HTTP Header.  The application requires that the HTTP Header value be 'All Caps'.  The HTTP Header value is being populated with either a lower case or mixed case value.

EXAMPLE:  

User Attribute: sSOHeader

Attribute Value: user2

Resulting HTTP Header: HTTP_SSOHEADER:user2

 

Environment

Policy Server: Any

Policy Store: Any

User Store: LDAP

Web Agent: Any

Web Server: Any

Cause

The HTTP Header will be populated with the value from the User Attribute the same way it is stored in the user store.  This is default behavior.  If the value is lower case or a mixed-case, that is what will be populated in the HTTP Header.

 

 

Resolution

Run UCASE against the value to convert it to upper case. However, that can only be done in a Virtual Attribute. This means a Named Expression will need to be created. The Named Expression is configured as a Virtual Attribute. It calls the attribute from the user directory, then runs UCASE against it. The Response calls the named Expression. 

 

1) Configure a Named Expression 

a) Select the 'Virtual Attribute' radio button.

-> Expression Name will be prefixed with "#" 

b) Name the Named Expression

-> example: #SSOHeaderNamedExpression 

c) Configure the following Expression: 

 UCASE(<Attribute Name>) 

 example: UCASE(sSOHeader) 

 

2) Configure a Response 

a) Response Attribute: WebAgent-HTTP-Header-Variable 

b) Attribute Kind: Expression 

c) Configure a Variable Name

example: SSOHEADER

c) Configure the name of the Named Expression in the Expression field. 

Expression: #SSOHeaderNamedExpression

Script (Resulting): SSOHEADER=<$expr="#SSOHeaderNamedExpression" $> 

In this example the user attribute is named "sSOHeader", and the value is in lower case. The Named Expression "#SSOHeaderNamedExpression" is calling the user attribute "sSOHeader" and running UCASE against the result. The Response is an expression calling the named expression. The result is the header attribute gets printed in upper case. 

 

EXAMPLE:  

User Attribute: sSOHeader

Attribute Value: user2

Resulting HTTP Header: HTTP_SSOHEADER:ADUSER2