Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Adding custom error messages in a post-authentication activity

Updated on July 1, 2021

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 begin: 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, clickCreate 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>").
    For example: tools.getParameterPage().putParamValue("pyPostAuthErrorFieldLabel", "customErrorMsgByMe")
  • Previous topic Application URL patterns for various authentication service types
  • Next topic Authenticating requests in services

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us