CA API Management: Customizing Error Codes for the OAuth Toolkit

Document ID : KB000072471
Last Modified Date : 01/03/2018
Show Technical Document Details
Question:
How can custom error codes be created for use within the OTK?
Answer:
1. Edit the policy #OTK Fail With Error Message 

#OTK Fail With Error Message Policy

2. Turn on comments and expand the 'custom' section. There is a sample branch you can copy and paste (All assertions must evaluate to true). Copy this branch and paste it inside the At least one branch 

Custom Error Branch

3. Change the rule for the compare assertion to something in the range of 700-899. In my example I will use 700. 

Compare Expression

4. Change the error message in the error.msg variable to the custom message. 

Error Message Custom

You can now utilize the 'OTK Fail with error message' assertion with the new error code
Sample Policy

Response