这是基于 sapic 的一个小的扩展模块, 用来接入 Passportd OIDC(OpenID Connect)登录。
安装
正式版本
$ pip install -U sapicd-oauth2-passportd
开发版本
$ pip install -U git+https://github.com/sapicd/oauth2-passportd.git@master
开始使用
此扩展请在部署 sapic 图床后使用,需要 其管理员进行添加扩展、设置钩子等操作。
添加:
请在 站点管理-钩子扩展 中点击安装第三方包,可在弹窗列表中选择 oauth2-passportd,点击行尾图标,或者在弹窗底部按照正式/开发版本填写安装。
安装完成后,在 站点管理-钩子扩展 中点击添加第三方钩子, 输入名称: oauth2passportd ,确认后提交即可加载这个模块。
配置:
在 站点管理-网站设置 底部的钩子配置区域配置以下参数:
Passportd 服务地址:OIDC Provider 的根地址,例如 https://passport.example.com
Passportd 客户端ID:在 Passportd 中注册的 OIDC Client ID
Passportd 客户端密钥:对应的 Client Secret
使用:
1、在 Passportd(你的 OIDC Server)中注册一个 OIDC Client。
回调地址(redirect_uri)是 sapic 地址,比如 https://sapic.example.com/extendpoint/oauth2passportd/callback
注意:scope选择profiel、email,其他参数根据实际填写。
提交后生成的 Client ID 和 Client Secret 是需要配置到 sapic 中的。
2、在 sapic 站点管理-网站设置 底部钩子配置区域中选择第三方认证为 oauth2passportd 即可。
启用后,在登录页面会显示使用 Passportd 登录,跳转到授权页,授权后跳回 sapic。
PS:
登录状态是依靠 session
用户名即 Passportd UID
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sapicd_oauth2_passportd-0.1.0.tar.gz.
File metadata
- Download URL: sapicd_oauth2_passportd-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15eaeaacdd3d99dc8ce872adadc3e06ded09f223d77e679f6aff4f8975d1669c
|
|
| MD5 |
8138c70f5fee1091d69cf7175c40e361
|
|
| BLAKE2b-256 |
0a20d4353b41b2895297951097ae05ced5ebcfec93707c921fa11e39b0a914af
|
File details
Details for the file sapicd_oauth2_passportd-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sapicd_oauth2_passportd-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a6eb6e88d26b67e705a5ebd2d7703f01fadb8e6592d43e8a31a875daf6a4da2
|
|
| MD5 |
b467d7b42068e5cf518c6b69b9465039
|
|
| BLAKE2b-256 |
1fbe750032f9f6b612b526a7f34f4550cc64922827b4834e899f763d5ea1e941
|