cors/document-auth

CORS - 文档认证

安装数量: 4,741

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 0

分支: 2

公开问题: 0

类型:pimcore-bundle

0.2.2 2024-06-11 14:52 UTC

This package is auto-updated.

Last update: 2024-09-17 11:47:51 UTC


README

此包允许在Pimcore文档上基于属性添加基本认证。

简单使用这些属性

  • password_enabled 复选框:启用和禁用密码
  • password_username 文本:用户名
  • password_password 文本:密码(原始文本)

安装

  1. 安装包 composer require cors/document-auth
  2. 启用包 bin/console pimcore:bundle:enable CORSDocumentAuthBundle
  3. 将安全配置复制到安全配置中

安全配置

security:
    enable_authenticator_manager: true

    password_hashers:
      Symfony\Component\Security\Core\User\InMemoryUser: 'auto'

    providers:
        document_auth_provider:
            id: CORS\Bundle\DocumentAuthBundle\Security\UserProvider

    firewalls:
        document_auth:
            request_matcher: CORS\Bundle\DocumentAuthBundle\Security\RequestMatcher
            http_basic:
                realm: Site
                provider: document_auth_provider

    access_control:
      - { path: ^/, role: ROLE_USER, attributes: {'_firewall_context': 'document_auth'}}