我正在使用 Confluence 4.2.5 (build 3284) 和 CAS SSO 连接到我的 LDAP 服务器,并且希望能够在用户更改密码时从 LDAP 服务器调用 synchroniseUserDirectories() 以便即时更改。
它现在的工作方式是用户必须等待 Confluence 运行它的定期 LDAP 同步,这可能会让他们感到不安。
我曾尝试使用 XML-RPC 接口调用 changeUserPassword()(作为管理员),但它不起作用。该操作引发异常“更改用户密码时出错...”。我认为这是因为用户是在 LDAP 中定义的,但我无法确定,因为异常消息并不清楚原因。
这是我希望能够使用的示例代码。它不起作用。
#!/usr/bin/env python
import xmlrpclib
url = 'https://docs.example.com'
admin_user = 'frobisher'
admin_pass = 'supersecretstuff'
username = 'bigbob'
new_password = 'bigbobsbigsecret'
server = xmlrpclib.ServerProxy(url + '/rpc/xmlrpc')
token = server.confluence2.login(admin_user, admin_pass)
# CITATION: https://developer.atlassian.com/display/CONFDEV/Remote+Confluence+Methods
# this doesn't exist but would be my preferred approach.
# It raises a NoSuchMethodException exception.
server.confluence2.synchroniseUserDirectories(token)
# this throws a general exception, because of the LDAP? The message
# wasn't clear about the source of the problem.
#server.confluence2.changeUserPassword(token,
# username,
# password)
server.confluence2.logout(token)
有没有办法使用 SOAP 或 REST 来做到这一点?我担心 REST,因为它听起来仍然是一个原型。
如果这些方法都不起作用,考虑到这必须是从 LDAP 服务器到 Confluence 服务器的推送操作,是否可以使用简单的插件来完成?我没有编写插件的经验,但我偶尔会做一些 java 工作。
任何提示将不胜感激。