Download the PHP package abel/keycloak-bearer-only-adapter-bundle without Composer

On this page you can find all versions of the php package abel/keycloak-bearer-only-adapter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package keycloak-bearer-only-adapter-bundle

ABELkeycloakBearerOnlyAdapterBundle

This Symfony bundle is an adapter that allows securing API using keycloak Bearer Only clients.

Installation

Befor installing the bundle, automatic packages configuration can be activated with the following command:

With composer:

Configuration

If you want to set up keycloak locally you can download it here and follow instructions from the official documentation.

Bundle configuration

Via a recipe (Automatic)

This bundle hase a Symfony recipe that allow the automation of configuration via the Symfony Flex Composer plugin. To enable recipe for your project, run the following command:

Manual

Having a running keycloak locally or in Docker and already configured a client with Access Type = bearer-only here is the configuration to use:

The best practice is to load your configuration from .env file.

Since Keycloak 17 the default distribution is now powered by Quarkus, while the legacy WildFly powered distribution will still be around until June 2022
The new distribution introduces a number of breaking changes, including:

  • /auth removed from the default context path
    ⚠️ If you are using a legacy version make sure to include /auth in OAUTH_KEYCLOAK_ISSUER
    Example: keycloak:8080/auth

In case of using Keycloak with Docker locally replace issuer value with your keycloak container reference in the network

For example, you can use the service name, or container IPAdresse that you can get using this command:

Symfony security configuration

To secure your API with Keycloak you must change the default security configuration in symfony.

Here is a simple configuration that restrict access to routes only to user with role ROLE_API :

:informationsource: Referring to Symfony documentation, roles must start with **ROLE** (otherwise, things won't work as expected)

Keycloak configuration

To configure keycloak to work with this bundle, here is a step by step documentation for a basic configuration of keycloak.

Compatibility

Bundle Version Symfony Version
V1.0.1 >=4.0.0 <5.0.0
V1.1.* (uses old authentication systeme with guard) >=5.0.0 <6.0.0
V1.2.* (uses new authentication systeme) >=5.3.0 <6.0.0
V1.3.* >=6.0.0 <7.0.0

All versions of keycloak-bearer-only-adapter-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.5
symfony/config Version ^6.0
symfony/dependency-injection Version ^6.0
symfony/http-kernel Version ^6.0
symfony/security-bundle Version ^6.0
guzzlehttp/guzzle Version ^6.3
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package abel/keycloak-bearer-only-adapter-bundle contains the following files

Loading the files please wait ...