Auto Generate user passwords and directly sending mail to respective users about their login credentials in Alfresco [duplicate]

*爱你&永不变心* 提交于 2019-12-20 04:24:06

问题


My task is to do the following in Alfresco:

When a user is created, the password is auto-generated and the login credentials being sent to the users email address directly, instead of the admin having to enter the password and sending it manually to the newly created users.

Please guide me how to start and proceed in this...


回答1:


You can refer to my answer for Creating user in alfresco

You can write some random algorithm to generate password. Also you can write some EmailService which can send the credential mail to the user.




回答2:


i know that this answer look's like Sachin Mesare's answer but it's a little bit différente, i will cut my answer to give something in every part of your question

Part 1 : Create User

1 - you have a start of an answer in this post answered by our friend Sachin Mesare Create Alfresco User

2 - you can see this solution maided by Alfresco Community Add a person JAVA API personally i used this method to create and add a person that worked fine for me (do not forget to read all the post : there's an improvement in the bottom)

Part 2 : Send an Email

1 - you can use this wonderful tutorial that give you the path to follow to send an EMail with Java Api Mail Java - Sending Email

2 - you can find so many StackOverFlow questions ( with answers ) that i selected this one Send email using java

Part 3 : Password

you have 2 ways to do something like that

Solution 1 : encrypte/decrypt it (it's a two ways working method) that mean that if you use an algorithme to encrypte it someone can use the same to decrypt your password.

Solution 2 : Hash it that's a one way method that mean if you hash your password no one even you can get the original password, the most well known method to Hash password is sha256

Hope that helped you



来源:https://stackoverflow.com/questions/40080238/auto-generate-user-passwords-and-directly-sending-mail-to-respective-users-about

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!