Adding custom error messages in a post-authentication activity
Default error messages in a post-authentication activity can be customized to provide users with more specific, helpful feedback. You can set custom error messages based on the post-authentication logic.
- In the navigation pane of DevStudio, click .
- Click Create.
- In the Label field, enter a label for this message, for example, customErrorMsgByMe.
- In the Field Name field, enter pyMessageLabel.
- In the Context section, set the Apply to field to @baseclass, and then click Create and open.
- In the To field, enter the custom error message that you want to display when this error occurs.
- Click Save.
- In the navigation pane of Dev Studio, click , and then click the authentication service that you previously created.
- In the Advanced Configuration Settings section, you can select the previously created custom activity. If you have not created one, you could create a new one based on the OOTB activity pySSOPostAuthenticationActivity.
- Click the Configure icon next to the
Post-authentication activity field, and then
if creating a new activity, click Create and open if copying the OOTB activity, click Save As - Set the Method field to Java.
- Click the Method Parameters section, and then in the
Java Source field, set the value of
pyPostAuthErrorFieldLabel to
tools.getParameterPage().putParamValue("pyPostAuthErrorFieldLabel", "<custom field value name>").
Previous topic Adding an application URL alias Next topic Authenticating requests in services