java 自助更改密码 api_搭建ldap自助修改密码系统--Self Service Password
发布日期:2021-06-24 14:45:20 浏览次数:4 分类:技术文章

本文共 2026 字,大约阅读时间需要 6 分钟。

系统版本:centos6

Self Service Password版本:1.1

服务安装:

安装依赖:yum install php70-ldap.x86_64 -y (版本尽量大于5.3,否则会提示更新php程序)

yum install httpd -y

安装Self Service Password:yum install https://ltb-project.org/rpm/6Server/noarch/self-service-password-1.1-1.el6.noarch.rpm

配置apache: /etc/httpd/conf.d/self-service-password.conf

NameVirtualHost *:80

ServerName changepasswd.xxxxx.net

DocumentRoot /usr/share/self-service-password

DirectoryIndex index.php

AddDefaultCharset UTF-8

AllowOverride None

Require all granted

LogLevel warn

ErrorLog /var/log/httpd/ssp_error_log

CustomLog /var/log/httpd/ssp_access_log combined

配置Self Service Password,支持密码修改和邮件重置: vim  /usr/share/self-service-password/conf/config.inc.php

#关闭 问题验证 和 短信验证(视个人需要):

$use_questions=false;

$use_sms= false;

#配置 LDAP

$ldap_url = "ldap://ldap.xxxxx.net";

$ldap_starttls = false;

$ldap_binddn = "cn=Manager,dc=ldap,dc=xxxxxx,dc=net";

$ldap_bindpw = "xxxxxxxxx";

$ldap_base = "dc=ldap,dc=xxxxxx,dc=net";

$ldap_login_attribute = "cn";

$ldap_fullname_attribute = "cn";

$ldap_filter = "(&(objectClass=person)($ldap_login_attribute={login}))";

$who_change_password = "manager";   #指定LDAP 以什么用户身份更改密码

#配置邮件

$mail_from = "elk@xxxxx.com";

$mail_from_name = "企业账号密码重置";

$mail_signature = "";

$notify_on_change = true;      #密码修改成功后,向用户发送通知邮件

$mail_sendmailpath = '/usr/sbin/sendmail';   #需安装sendmail服务 yum install -y sendmail

$mail_protocol = 'smtp';

$mail_smtp_debug = 0;

$mail_debug_format = 'html';

$mail_smtp_host = 'smtp.gmail.com';

$mail_smtp_auth = true;

$mail_smtp_user = 'elk@xxxxxx.com';

$mail_smtp_pass = 'xxxxxx';

$mail_smtp_port = 587;

$mail_smtp_timeout = 30;

$mail_smtp_keepalive = false;

$mail_smtp_secure = 'tls';

$mail_contenttype = 'text/plain';

$mail_wordwrap = 0;

$mail_charset = 'utf-8';

$mail_priority = 3;

$mail_newline = PHP_EOL;

配置完成,登录网页访问,通过网页修改账号密码验证

a386727198f9997f7747e4c138f9c729.png

如果遇到以下错误:

56db9e25d23a08bf3bb6218524ce8d97.png

修改配置: $keyphrase = "secret";   --->  $keyphrase = "ldapchangepasswd"; #任意字符串

验证邮件重置密码:

6f06d50ee04c50e7533ede7c30852424.png

查看邮件,点击链接修改即可:

3a07da8d60591cc4c5a4111026045a1b.png

修改完成会收到一条邮件:

94e9f51e6c2eaa6d1afdbaee5fbe8841.png

以上便是ldap自主修改密码服务--Self Service Password 的配置。

参考链接:http://blog.leanote.com/post/benmo/e98d072f2b28

转载地址:https://blog.csdn.net/weixin_33443932/article/details/114545692 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:java 中断线程 wait_Java 线程中断(interrupt)与阻塞 (park)的区别
下一篇:java display.getdefault()_java基础(十一 )-----反射——Java高级开发必须懂的

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年04月08日 13时31分12秒