Smtp 使用WSO2向用户发送电子邮件以进行验证

Smtp 使用WSO2向用户发送电子邮件以进行验证,smtp,wso2carbon,wso2is,email-verification,Smtp,Wso2carbon,Wso2is,Email Verification,我对wso2完全陌生。我正在尝试向用户发送电子邮件,以验证我(管理员)在默认主域中为特定公司(不是通过gmail)创建的新帐户。使用该链接,他们应该能够登录并设置新密码。为此,我遵循以下步骤: (1) 正在设置identity-mgt.properties文件 # Identity listener is enable Identity.Listener.Enable=true # Enable email sending function when recovering the accou

我对wso2完全陌生。我正在尝试向用户发送电子邮件,以验证我(管理员)在默认主域中为特定公司(不是通过gmail)创建的新帐户。使用该链接,他们应该能够登录并设置新密码。为此,我遵循以下步骤:

(1) 正在设置identity-mgt.properties文件

# Identity listener is enable

Identity.Listener.Enable=true

# Enable email sending function when recovering the account and verifying the user creation

Notification.Sending.Enable=true
Notification.Expire.Time=7200

# Enable internal email sending module. If "false", email sending data would be available to application via webservice. Then application can send the email using its own email sender 

Notification.Sending.Internally.Managed=true

# Enable verification of account creation. When self registration is done,  user would be verified by sending email (confirmation link) to user's email account
 
UserAccount.Verification.Enable=true

UserAccount.Recovery.Enable=false


# Whether user can do the verification or not. If value is defined for role, Then the email is sent to users that have been assigned to this role. Not for the user who is registered.

UserAccount.Verification.Role=

# Whether captcha verification is done by identity server or application level

Captcha.Verification.Internally.Managed=true

# Whether temporary password are used when creating users or recovering accounts

Temporary.Password.Enable=false
Temporary.Password.Default.Value=password
Temporary.Password.OneTime=false
Temporary.Password.Expire.Time=0

# Enable authentication rules other than password check 

Authentication.Policy.Enable=true

# Enable following checking on authenication.  By default account lock check is enable 

Authentication.Policy.Check.Account.Exist=false 
Authentication.Policy.Check.Account.Lock=false
Authentication.Policy.Check.OneTime.Password=false
Authentication.Policy.Check.Password.Expire=false

# Configuration to build an authentication policy

Authentication.Policy.Password.Expire.Time=0
# If account verification is not enabled, following property will decide where user must be lock or not after user is created 
Authentication.Policy.Account.Lock.On.Creation=false
Authentication.Policy.Account.Lock.Time=0
Authentication.Policy.Account.Lock.On.Failure=false
Authentication.Policy.Account.Lock.On.Failure.Max.Attempts=0

# Define pluggable extension points

Identity.Mgt.Random.Password.Grenerator=org.wso2.carbon.identity.mgt.password.DefaultPasswordGenerator
Identity.Mgt.User.Data.Store=org.wso2.carbon.identity.mgt.store.UserStoreBasedIdentityDataStore
Identity.Mgt.Notification.Sending.Module.1=org.wso2.carbon.identity.mgt.mail.DefaultEmailSendingModule
Identity.Mgt.User.Recovery.Data.Store=org.wso2.carbon.identity.mgt.store.RegistryRecoveryDataStore


# Define password policy enforce extensions

Password.policy.extensions.1=org.wso2.carbon.identity.mgt.policy.password.DefaultPasswordLengthPolicy
Password.policy.extensions.1.min.length=6
Password.policy.extensions.1.max.length=12
Password.policy.extensions.2=org.wso2.carbon.identity.mgt.policy.password.DefaultPasswordNamePolicy
Password.policy.extensions.3=org.wso2.carbon.identity.mgt.policy.password.DefaultPasswordPatternPolicy
Password.policy.extensions.3.pattern=^((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%&*])).{0,100}$
(2) 正在设置axis2.xml文件。。。。 在本文中,我取消了transportSender name=“mailto”部分的注释,并添加了参数值。我还未注释transportReceiver name=“mailto”部分。 transportSender name=“mailto”部分中的参数为:-

<transportSender name="mailto"
                     class="org.apache.axis2.transport.mail.MailTransportSender">
        <parameter name="mail.smtp.from"></parameter>
        <parameter name="mail.smtp.user"></parameter>
        <parameter name="mail.smtp.password"></parameter>
        <parameter name="mail.smtp.host"></parameter>

        <parameter name="mail.smtp.port"></parameter>
        <parameter name="mail.smtp.starttls.enable"></parameter>
        <parameter name="mail.smtp.auth"></parameter>
    </transportSender>

(3) 这是email-admin-config.xml文件某些部分的默认设置

<configuration type="askPassword">
  <targetEpr></targetEpr>
  <subject>WSO2 Carbon - Password Change for New Account</subject>
  <body>
Hi {first-name}

Please change your password for the newly created account : {user-name}. Please click the link below to create the password.

http://localhost:9443/InfoRecoverySample/infoRecover/verify?confirmation={confirmation-code}

If clicking the link doesn't seem to work, you can copy and paste the
link into your browser's address window.
  </body>
  <footer>
Best Regards,
WSO2 Carbon Team
http://www.wso2.com
  </footer>
  <redirectPath></redirectPath>
</configuration>

WSO2 Carbon-新帐户的密码更改
你好{名字}
请更改新创建帐户的密码:{user name}。请单击下面的链接创建密码。
http://localhost:9443/InfoRecoverySample/infoRecover/verify?confirmation={确认码}
如果单击链接似乎不起作用,您可以复制并粘贴
链接到浏览器的地址窗口。
顺致敬意,
WSO2碳团队
http://www.wso2.com
现在,当我通过选择“询问密码”选项创建一个新用户时,我得到了这个错误。但是用户是在默认域中创建的

“无法添加用户主/addUser。错误为:doPostAddUser时出错”

我在许多网站上搜索了完整的过程,但没有得到关于不同文件中每个参数的用途的任何适当文档,以便为我的使用进行自定义

请让我知道哪里出了问题,以及我需要配置的所有其他东西。 此外,了解所有参数所需的来源


提前感谢。

验证
存储库\conf\security\identity mgt.properties中的以下参数是否设置为false:

Authentication.Policy.Account.Lock.On.Creation=false
我必须补充一点

-Djava.net.preferIPv4Stack=true 
wso2server
脚本中

邮件发送就像一种魅力

接下来,我添加了以下声明映射:描述:身份密码时间戳声明Uri:属性:facsimileTelephoneNumber似乎有问题(bug?)对于UI:Attribute值,仅在创建映射后就包含null,我必须修改映射并用facsimilephonenumber覆盖null。之后,创建过程运行良好