Download the PHP package berthott/laravel-keycloak-users without Composer

On this page you can find all versions of the php package berthott/laravel-keycloak-users. 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 laravel-keycloak-users

Laravel-Keycloak-Users

Laravel user administration in Keycloak.

Keycloak user administration utilizing haizad/laravel-keycloak-admin for Keycloak API communication. Working hand in hand with robsontenorio/laravel-keycloak-guard and / or Vizir/laravel-keycloak-web-guard for Keycloak authorization.

Creates a user representation on Laravel side and hooks into the model events to create the users in keycloak. Optionally syncs the current Keycloak state into Laravel.

Keycloak as a guard for your Laravel application

You will most likely want to set up Keycloak as a web or api guard for you application. You might set up robsontenorio/laravel-keycloak-guard as an api guard and Vizir/laravel-keycloak-web-guard as an webguard. An example set up might be:

Installation:

Your .env file:

Your auth.php config:

The KEYCLOAK_CLIENT_ID will be a Keycloak OpenID Connect client allowing Standard flow and Direct access grants and Client authentification + Authorization turned OFF. This means there will be no KEYCLOAK_CLIENT_SECRET set. This is our web client.

And additional Keycloak OpenID Connect client allowing Standard flow and Direct access grants and Client authentification + Authorization turned ON needs to be set up as our api client. The KEYCLOAK_ALLOWED_RESOURCES is a string that will be verified by the api guard to be present inside the JWT token, that the Frontend received from the web client.

Installation

In Laravel

Additionaly to the guard environment variables set:

In Keycloak

Setup a client, with Access Type: confidential and Service Accounts Enabled: true. Set Realm Settings > Login > Edit Username: true. Add manage-users, query-users, view-users to Roles > Default Roles > realm-management. Add the value chosen for the api guards KEYCLOAK_ALLOWED_RESOURCES to Clients > (your Web Client) > Mappers as Hardcoded Role.

Usage

The package is loaded into Laravel automatically. A default user model is generated with ready to use API Resource Routes.

The package will add the following routes:

Changing the User Model

Changing the Welcome Email for new users

When creating a new user in Laravel a random password is generated and sent to the user. At the same time a new Keycloak user is generated with this very password. The password is temporary and is required to be updated on the first login. To change the Welcome Email please use php artisan vendor:publish --provider="berthott\KeycloakUsers\KeycloakUsersServiceProvider" --tag="views".

Options

To change the default options use

Dependencies

The User model is created the laravel-crudable package.

Compatibility

Tested with Laravel 10.x and Keycloak 20.

License

See License File. Copyright © 2023 Jan Bladt.


All versions of laravel-keycloak-users with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.3
berthott/laravel-crudable Version ^3.0
haizad/laravel-keycloak-admin Version ^1.9
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 berthott/laravel-keycloak-users contains the following files

Loading the files please wait ....