2014-07-11 115 views
0

我對wso2完全陌生。我正在嘗試向用戶發送一封電子郵件,以驗證我(管理員)爲默認主域中的特定公司(而不是通過gmail)創建的新帳戶的驗證。使用該鏈接,他們應該能夠登錄並設置新的密碼。爲此,我遵循的步驟是:發送電子郵件給用戶使用WSO2進行驗證

(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])(?=.*[[email protected]#$%&*])).{0,100}$ 

(2)設置axis2.xml文件.... 在該予未註釋的transportSender名稱= 「mailto」部分並添加參數值。我還取消了transportReceiver name =「mailto」部分的註釋。在transportSender名 參數= 「電子郵件地址」 部分是: -

<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)這是電子郵件管理員-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> 

現在,當我通過選擇「詢問密碼」選項創建新用戶時,我收到此錯誤。但用戶正在默認域中創建。

「不能添加用戶PRIMARY/ADDUSER錯誤是:錯誤而doPostAddUser」

我搜索有關的完整過程在很多網站,但沒有得到關於怎樣在不同的文件中每個參數的任何適當的文件以便爲我的使用定製。

請讓我知道我出錯的地方,以及我需要配置的其他東西。 此外,理解所有參數所需的資源。

在此先感謝。

回答

0

驗證下面的參數設置爲false repository\conf\security\identity-mgt.properties

Authentication.Policy.Account.Lock.On.Creation=false 
+0

繼http://mail.wso2.org/mailarchive/dev/2014-December/040210.html我加入folowwing權利要求映射: 描述:身份口令時間戳 權利要求Uri:http://wso2.org/claims/identity/passwordTimestampMapped屬性:facsimileTelephoneNumber 用戶界面似乎存在一個問題(bug?):映射創建後,屬性值包含null juste,我必須修改映射並覆蓋null with facsimileTelephoneNumber 之後,創建過程很好地工作 – Newuser

1

我不得不在wso2server腳本中添加

-Djava.net.preferIPv4Stack=true 

郵件發送工作就像一個魅力

相關問題