con4gis/oauth

OpenID Connect 验证所需功能的认证包

安装: 88

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 3

分支: 1

类型:contao-bundle

v1.0.2 2022-02-02 17:25 UTC

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。