Configured the API gateway to use Authenticate against CA SSO for authentication and authorization.
The policy only fails when special characters are included in the username or password.
Simplified steps to reproduce: Policy
Set Context variables for username and password: username=A10, password=fi&erwall
Set Context variables for creds message XML format
Set XPath Credentials Properties
Policy will fail when username or password contains a special character at the XPath assertion (&, <, >, '', ')
API Gateway 9.4
Single Sign-On 12.8
In order for this to work with special characters, they need to be escaped as below:
XPath expression
The issue is not a product limitation, it is an XML limitation.
"Require XPath credentials" assertion has limitations on XML
If you test the data in any XPath tester, you would see that the &, for example, will need to be escaped with amp;
You could use the "Evaluate Regular Expression" and replace the & in the password with &
https://www.freeformatter.com/xpath-tester.html
XML Input
<creds>
<username>A10</username>
<password>fi&rewall</password>
</creds>
XPath expression
/creds/password
Errors with
Unable to perform XPath operation. The reference to entity "rewall" must end with the ';' delimiter. You most likely forgot to escape '&' into '&'
Attached sample policy sample-policy.xml
The following flow
IsProtect to SSO
Set context variable username and password that contains special character “&”
Evaluate Regular Expression fi&rewall change it to fi&rewall, save to context variable password1
Set context variable “creds”
<creds>
<username>${username}</username>
<password>${password1}</password>
</creds>
XPath
/creds/username
/creds/password
$creds Authenticate Against CA Single Sign-On