PHPackages                             colq2/laravel-keycloak - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. colq2/laravel-keycloak

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

colq2/laravel-keycloak
======================

A keycloak adapter for laravel.

v0.3(7y ago)21BSD-2-ClausePHPPHP ^7.1

Since Mar 19Pushed 7y agoCompare

[ Source](https://github.com/colq2/laravel-keycloak)[ Packagist](https://packagist.org/packages/colq2/laravel-keycloak)[ RSS](/packages/colq2-laravel-keycloak/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (10)Versions (4)Used By (0)

IMPORTANT
=========

[](#important)

This is going to be an easy-to-use keycloak adapter for laravel.

This is still in development and not ready for production.

Feel free to contribute to this.

To do
=====

[](#to-do)

\[ \] Allow different user storage's like Cache, Session, Eloquent, Database etc.

Installation
============

[](#installation)

`composer require colq2/laravel-keycloak`

Publish config and migrations

`php artisan vendor:publish --provider=colq2\Keycloak\KeycloakServiceProvider`

This project redefines the user model and migrations. There is no need for password reset table. Furthermore we need another properties on the user (This are mostly the openid-connect defined properties):

- id
- sub
- username
- name
- email
- picture
- roles

You can delete all migrations in your laravel project if you want to use keycloak as the only auth possibility.

Add following to your .env file:

```
KEYCLOAK_USER_MODEL=
KEYCLOAK_BASE_URL=
KEYCLOAK_REALM=
KEYCLOAK_CLIENT_ID=
KEYCLOAK_CLIENT_SECRET=
KEYCLOAK_REDIRECT=/callback

```

Usage
-----

[](#usage)

Controller:

```
