innis-maggiore/silverstripe-google-auth

此包已被弃用,不再维护。未建议替代包。

使用谷歌网站登录验证CMS用户

1.0 2018-08-18 18:56 UTC

This package is auto-updated.

Last update: 2023-04-25 23:51:47 UTC


README

目前支持Silverstripe 3.x

安装

composer require "innis-maggiore/silverstripe-google-auth"

YAML配置

GSuiteAuthExtension:
  client_id:
    '<YOUR ID>.apps.googleusercontent.com'

GSuiteAuthenticator:
  domain:
    '<yourdomain.com>'
  create_new_users:
    true
  default_new_user_group:
    'content-authors'

启用验证器

在您站点的main _config.php中

# You can (optionally) disable the stock Authenticator
Authenticator::unregister('MemberAuthenticator');

# Enable Google Authenticator
Authenticator::register_authenticator('GSuiteAuthenticator');

注意

所使用的域必须在Google开发者控制台中启用才能工作。在Google开发者控制台中创建您的项目,设置新的凭证。将您的域名添加到“授权JavaScript来源”。

资源

谷歌登录文档