Skip to main content


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

Generating a one-time password by calling an activity

Updated on June 30, 2021

You can generate a one-time password by calling an activity. Use this method to use a one-time password in an application that is running on Pega Platform version 7.3 or later.

Before you begin: Complete the Configuring multifactor authentication policies procedure.
  1. Create an activity.

    For more information about how to create an activity, see Creating an activity.

  2. On the Pages & Classes tab of the Activity form, define the page that passes the parameters to the pxSendOTP activity and an OperatorID page to access the Operator instance.
    1. In the Page name field, enter the name of the page that passes parameters to the activity.
      For example: OTPInputs
    1. In the Class field, enter Embed-OTPInputs.
    2. Click the Plus icon to add a new parameter.
    3. In the Page name field, enter OperatorID.
    4. In the Class field, enter Data-Admin-Operator-ID.
  3. On the Steps tab, in the first step, create a page.
    1. In the Method list, press the Down Arrow key, and select Page-New.
    2. In the Step page field, enter the name of the previously defined page that passes the parameters.
      For example: OTPInputs
  4. Add a second step to the activity to configure the page properties
    1. In the Method field, click the Down Arrow key, and select Property-Set.
    2. In the Step page field, enter the name of the page that passes parameters to the activity.
      For example: OTPInputs
    3. Click the Expand icon, and then provide the following name-value pairs in the PropertiesName and PropertiesValue fields:

      pyContextEnter a description of the business context for which the one-time password is being generated.
      pySendModeEnter EMAIL. This method is to send the one-time password to the user.
      pyEmailSettings.pyEmailAccountEnter the email account that is used for outbound email messages.
      pyEmailSettings.pyCorrNameEnter the correspondence name for the email message. The .pyOTP property must be inserted in the correspondence content. If no value is provided for this parameter, the default pyDefaultOTPCorr correspondence name that is in Work- class is used.
      pyEmailSettings.pyToAddressEnter the email address to which the one-time password should be sent.
      pyEmailSettings.pySubjectEnter a subject line for the generated email message.
      pyInputClassEnter your application level work class so that you are able to refer to a correspondence rule that exists in your application level work class.
  5. Add a third step to the activity that calls the pxSendOTP activity.
    1. In the Method field, enter Call pxSendOTP.
    2. In the Step page field, enter OperatorID.
  6. Add a fourth step to the activity that reads the Reference ID.
    1. In the Method field, click the Down Arrow key, and select Property-Set.
    2. In the Step page field,enter the name of the OTPInputs page.
      For example: OTPInputs
    3. Click the Expand icon, and then provide the following name-value pairs in the PropertiesName and PropertiesValue fields:

      PropertiesName field — Enter the name of the property that stores the Reference ID on the Primary page. For example: Primary.OTPRefID.

      PropertiesValue field — Enter .pyReferenceID.

  7. Click Save.
What to do next: Complete the Verifying a one-time password procedure.

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