acsystems / keycloak-authenticator-bundle
无状态JWT身份验证的Keycloak连接器
1.1.0
2024-01-10 14:18 UTC
Requires
- php: >=8.1
- ext-openssl: *
- firebase/php-jwt: ^6.10
- symfony/cache: >=6.1
- symfony/security-bundle: >=6.1
- symfony/yaml: >=6.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-10 15:46:54 UTC
README
此包的目标是提供用于Symfony的Keycloak令牌认证器。
文档
快速开始
安装
使用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 |
贡献
在贡献之前,请阅读我们的贡献指南。