con4gis / oauth
OpenID Connect 验证所需功能的认证包
v1.0.2
2022-02-02 17:25 UTC
Requires
- php: ^7.4 || ^8.0
- contao/core-bundle: ^4.9
- doctrine/data-fixtures: ^1.4.4
- doctrine/orm: ^2.8.1
- guzzlehttp/guzzle: ^6.5
- knpuniversity/oauth2-client-bundle: ^2.0
- menatwork/contao-multicolumnwizard-bundle: ^3.5.2
- stevenmaguire/oauth2-keycloak: ^2.0
Conflicts
- contao/core: *
- contao/manager-plugin: <2.0 || >=3.0
This package is auto-updated.
Last update: 2024-09-16 12:42:17 UTC
README
此包为Contao前端用户添加OAuth认证功能。此外,您还可以使整个前端仅通过上游登录进行访问。
当前此包仅支持OpenID Connect服务器。
安装
步骤1:安装包
您可以使用composer或contao管理器安装此包。使用composer,请使用以下命令
$ composer require con4gis/oauth
在contao管理器中,您可以在“con4gis/oauth”下找到此包。
步骤2:配置包
安装后,您需要在config/config.yml中配置应用程序。
OpenID-Connect
parameters: con4gis.oauth.oidc.client_id: "### The client id for the openid connect server ###" con4gis.oauth.oidc.client_secret: "### The client secret for the openid connect server ###" con4gis.oauth.oidc.auth_server_url: "### The authentication url for the openid connect server ###" con4gis.oauth.oidc.realm: "### The realm for the openid connect server ####" # Uncomment the following option if you want to access the entire frontend via an upstream login #con4gis.oauth.oidc.secured: "true"
步骤3:清除缓存
您现在可以通过contao管理器或contao控制台清除缓存。
$ php vendor/bin/contao-console cache:clear -e prod
步骤4:配置登录模块
如果您的整个前端不通过上游登录进行访问,则此步骤是必要的。
在contao后端中,您可以创建新的OAuth登录模块。在那里,您可以设置将分配给新登录的用户组以及将存储在contao数据库中的用户数据。默认情况下,保存用户名。
该模块创建了一个新的登录按钮,您可以在网站的任何位置放置它。
回调URL
要成功登录,您需要在OAuth应用程序中允许以下回调URL。