LinkedIn
Copied!

Table of Contents

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.

Before you can add custom error messages in a post-authentication activity, you must first create an authentication service. For more information, see Creating an authentication service.
  1. In the navigation pane of DevStudio, click Records > Data Model > Field Value .

  2. Click Create.

  3. In the Label field, enter a label for this message, for example, customErrorMsgByMe.

  4. In the Field Name field, enter pyMessageLabel.

  5. In the Context section, set the Apply to field to @baseclass, and then click Create and open.

  6. In the To field, enter the custom error message that you want to display when this error occurs.

  7. Click Save.

  8. In the navigation pane of DevStudio, click Records > SysAdmin > Authentication Service , and then click the authentication service that you previously created.

  9. 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.

  10. 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
  11. Set the Method field to Java.

  12. 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>").

    tools.getParameterPage().putParamValue("pyPostAuthErrorFieldLabel", "customErrorMsgByMe")

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.