Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abame/symfony-keycloak-sso

SSO With Keycloak and Symfony 4.4
https://github.com/abame/symfony-keycloak-sso

docker keycloak nginx php php-fpm sso symfony

Last synced: 17 days ago
JSON representation

SSO With Keycloak and Symfony 4.4

Awesome Lists containing this project

README

        

# Nginx PHP MySQL Keycloak SSO

## Run Application

To have the application running clone the repository and execute the following commands:

```sh
$ docker-compose build
$ docker composer up -d
```

## Create database

First update the database configuration `DATABASE_URL` in `.env` file with the correct values and then run the following commands:

```sh
$ docker-composer exec php bin/console doctrine:database:create
$ docker-composer exec php bin/console doctrine:schema:update --force
```

Update also `IDP_ENTITY_ID` and `IDP_XML_CONFIG` in `.env` file in case you change the configuration path for the xml metadata or entity id URL.

In case entity id URL is changed a new client has to be created in keycloak.

## Test the application

You can access the application in `http://127.0.0.1/` and try to login.
You will be redirected to keycloak UI to either login or register, and you will be redirected back to symfony application with a logged-in user session

## Access Keycloak admin panel

The admin panel is accessible in `http://127.0.0.1:8080/auth/admin/` and you can login with username `root` and password `root`