Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: if we are using smtp with gmail we have to enable less secure app

...

  1. Shut down the server if it is running.
  2. Open the  <IS_HOME>/repository/conf/axis2/axis2.xml file, uncomment the  transportSender name = "mailto" configurations, and update the following properties:

    mail.smtp.fromProvide the email address of the SMTP account.
    mail.smtp.userProvide the username of the SMTP account.
    mail.smtp.passwordProvide the password of the SMTP account.
    Code Block
    <transportSender  name="mailto"
    class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter  name="mail.smtp.from">{SENDER'S_EMAIL_ID}</parameter>
    	<parameter  name="mail.smtp.user">{USERNAME}</parameter>
    	<parameter  name="mail.smtp.password">{PASSWORD}</parameter>
    	<parameter  name="mail.smtp.host">smtp.gmail.com</parameter>
        <parameter  name="mail.smtp.port">587</parameter>
        <parameter  name="mail.smtp.starttls.enable">true</parameter>
        <parameter  name="mail.smtp.auth">true</parameter>
    </transportSender>
    If you are using Gmail account you have to on "Allow less secure apps" in your account.
  3. Comment out the <module ref="addressing"/> property to avoid syntax errors.

    Code Block
    <!-- <module ref="addressing"/> -->
  4. Add the following email template to the <IS_HOME>/repository/conf/email/email-admin-config.xml.

    Code Block
    languagexml
    <configuration type="EmailOTP" display="idleAccountReminder" locale="en_US" emailContentType="text/html">
       <targetEpr></targetEpr>
       <subject>WSO2 IS Email OTP</subject>
       <body>
          Hi,
          Please use this one time password {OTPCode} to sign in to your application.
       </body>
       <footer>
          Best Regards,
          WSO2 Identity Server Team
          http://www.wso2.com
       </footer>
       <redirectPath></redirectPath>
    </configuration>
  5. Configure the following properties in the <PRODUCT_HOME>/repository/conf/identity/identity-mgt.properties file to true.

    Code Block
    languagexml
    Authentication.Policy.Enable=true
    Authentication.Policy.Check.OneTime.Password=true
  6. Start WSO2 IS.

...