docebo lms的单点登录实现

doceboSSO的Python项目详细描述


这个包允许一个简单的python接口添加第三个 单方登录Docebo学习管理系统。Docebo的 SSO不创建不存在的用户,或更新凭据。 存在的用户的。

用法

有两种方法可以使用此包,具体取决于 Docebo登录时需要的自定义。

用户api

用户API是一种简单、灵活的同步DoeBo用户的方法集。 使用本地创建的用户对象。要使用这些方法,docebooser 对象必须首先用要实例化的所有信息 与Docebo中的用户同步

有效用户参数的完整列表可以在Docebo的API中找到 参考: https://www.docebo.com/wp-content/uploads/media/Docebo_APImanual.pdf

from doceboSSO import docebo_user

new_user= DoceboUser(userid='batman',
 firstname='john',
 lastname='Doe',
 ...
)

接下来,lms的api和sso密钥以及托管域必须是 已初始化。此方法还将创建适当的散列和 使用Docebo的API所需的标记

new_user.initialize_keys(domain='http://example.docebosaas.com'api_key='xxxxxxxxxx'api_secret='xxxxxxxxxx'sso_token='xxxxxx')

最后,可以使用docebouser api中的方法与 Docebo–这些方法使用您输入到Docebouser中的参数 对象并生成有效的params/api_键。

if new_user.verify_existence():
  new_user.update_on_docebo()else:
  new_user.create()redirect_url= new_user.signin()

上面是一个简单的脚本,用于创建在 第一步,如果在DOCEBO上不存在他们的用户ID,并更新它们 用户参数,如果它们确实存在。

重定向到将包含一个有效的、已签名的URL以登录到该用户的 Docebo上的帐户,可以重定向到浏览器或粘贴到浏览器中。

以下调用也可用于更新指定的用户 本地docebooser上的属性。然后可以将此信息推送到 docebo/用于创建新用户。

new_user.update_info_locally(firstname='jane',
  lastname='dae',
  ...
)

可用的方法有:

All of these methods return boolean values for success for easy control flow

from doceboSSO import docebo_user

# Initialize user object with keys, secrets and domain
initialize_keys(self, domain, api_secret, api_key, sso_secret)# Verify user exists in Docebo
# Hits /api/user/checkUsername
verify_existence(self)# Update remote user params given local user information
update_on_docebo(self)# Create a new user based on local user
# Hits /api/user/create
create(self)# Delete user
# Hits /api/user/delete
delete(self)# Sign user in (if account exists), and return URL which will sign that user into their docebo account
signin(self)# Update local user's information
update_info_locally

要调用docebo上的delete或update,需要给定用户的docebo唯一ID。

< H3> CREATE()和VelIFyIOFIDENTION()自动在成功版本EH3>上添加该字段

您也可以使用以下方法手动添加uid。

new_user.set_docebo_unique_id(#####)

方法API

第二种交互方法不那么抽象,但是给了用户 更多的控制参数。用户api生成参数和 为用户填写信息,方法api要求用户 每次调用时输入一组参数作为字典。

可以找到为每个方法生成的参数的正确格式 地点: https://www.docebo.com/wp-content/uploads/media/Docebo_APImanual.pdf

api_密钥、api_机密和sso_机密仍必须初始化为 在用户api中。

可用的方法有:

These methods return the json body of the responses they receive.

# Verify user exists in Docebo
verify_user(self, params)# Update user params w/input params
edit_user(self, params)# Create a new user given input params
# If called on a user that already exists, returns None
create_user(self, params)# Delete user corresponding to provided unique_id
delete_user(self, params)# Sign user in (if account exists), and return URL which will sign that user into their docebo account
setup_valid_sso_path_and_params(self, username)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java组在不同线程中记录消息   java Wicket挂载404错误页   Java:如何制作对象数组的副本?   类似Windows中的java日期时间选择器   java无法获取JTextField用户输入以搜索文本文件   安卓 Java:如何随机更改背景和字体颜色   Java定时器中的摆动变化延迟   java让Selenium暂停X秒   将响应传递到视图时发生java Nativescript错误   java刷新安卓列表视图的最佳方式是什么?   单java进程的多线程队列/工作线程体系结构   web服务Java NoSuchMethodException   java groupingBy和filter一步到位   java游标。getCount()给定错误   即使引用的文件位于项目根目录中,java PrintWrite仍会持续引发“未找到文件”异常