acsystems/keycloak-authenticator-bundle

Keycloak connector for stateless JWT authentication

1.1.0 2024-01-10 14:18 UTC

This package is auto-updated.

Last update: 2024-04-10 14:51:05 UTC


README

The goal of this bundle is to provide a Keycloak token authenticator for Symfony.

License PHP Code Style

Documentation

Quick start

Installation

Install the package from packagist using composer

composer require acsystems/keycloak-authenticator-bundle

Add the bundle.

config/bundles.php

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

Set up Symfony Security to use the custom authenticator.

config/packages/security.yaml

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

  access_control:
    # ...

Add your keycloak base url and realm

config/packages/keycloak_authenticator.yaml:

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

Configurable parameters

NameTypeUsage
base_uristringURL to your keycloak instance
realmoptional stringRealm name, will be derived if not present
client_idoptional stringHuman readable client_id, will be derived if not present

Upgrading

For version migrations instructions see upgrade instructions.

Supported platforms

These are the platforms which are officially supported by this package. Any other versions might work but is not guaranteed.

PlatformVersion
PHP^8.1
Symfony^6.1

Contributing

Please read our contribution guidelines before contributing.