acsystems/keycloak-authenticator-bundle

无状态JWT身份验证的Keycloak连接器

安装: 113

依赖者: 0

建议者: 0

安全性: 0

类型:symfony-bundle

1.1.0 2024-01-10 14:18 UTC

This package is auto-updated.

Last update: 2024-09-10 15:46:54 UTC


README

此包的目标是提供用于Symfony的Keycloak令牌认证器。

License PHP Code Style

文档

快速开始

安装

使用composer从Packagist安装此包

composer require acsystems/keycloak-authenticator-bundle

添加该包。

config/bundles.php

return [
    ACSystems\KeycloakAuthenticatorBundle\ACSystemsKeycloakAuthenticatorBundle::class => ['all' => true]
];

设置Symfony Security以使用自定义认证器。

config/packages/security.yaml

security:
  firewalls:
    main:
      stateless: true
      custom_authenticators:
        - ACSystems\KeycloakAuthenticatorBundle\Security\KeycloakTokenAuthenticator

  access_control:
    # ...

添加您的Keycloak基本URL和领域

config/packages/keycloak_authenticator.yaml

acsystems_keycloak_authenticator:
  keycloak_authenticator:
    base_uri: 'https://example.com/'
    realm: 'example-realm'

可配置参数

名称类型用法
base_uri字符串指向您的Keycloak实例的URL
realm可选字符串领域名称,如果不存在则自动推导
client_id可选字符串可读的client_id,如果不存在则自动推导

升级

有关版本迁移说明,请参阅升级说明

支持的平台

以下是由此包官方支持的平台。其他版本可能也能工作,但不能保证。

平台版本
PHP^8.1
Symfony^6.1

贡献

在贡献之前,请阅读我们的贡献指南