> For the complete documentation index, see [llms.txt](https://farci-logan.gitbook.io/journal-de-bord/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://farci-logan.gitbook.io/journal-de-bord/security/authorization-server-keycloak.md).

# Authorization Server (Keycloak)

## **Keycloak**

Keycloak is an open-source Identity and Access Management solution administered by RedHat, and developed in Java by JBoss. More documentation about Keycloak can be found [here](https://www.keycloak.org/). A code sample of an embedded server (Spring Boot) can be found [here](https://github.com/Baeldung/spring-security-oauth/tree/master/oauth-rest/oauth-authorization-server).

**Note:** the server could be running on a VM or something in a standalone mode and configured using the Admin Console. This process is described [here](https://www.keycloak.org/docs/latest/server_admin/). I chose de deploy it in a Spring Boot embedded application to make the deployment process easier.

## **Configuration in the Admin Console**

Some core concepts need to be understood to configure the server properly. They are explained [here](https://www.keycloak.org/docs/latest/server_admin/#core-concepts-and-terms).

The embedded server is created using a realm import file. The file is in the project repository and can be found in resources/journal-de-bord-realm.json file.

### **Identity Providers**

I would like to enable login with Google. [Here](https://www.keycloak.org/docs/6.0/server_admin/#google) are the steps to follow.

It is possible to add a Google button, resources are provided by Google [here](https://developers.google.com/identity/branding-guidelines).

<https://developers.google.com/identity/sign-in/web/build-button>

### **Theme customization**

It is possible to customize the look and feel of the Keycloak GUI. Here are two key tutorials:

* <https://www.baeldung.com/spring-keycloak-custom-themes> (explains how theme are added in an embedded server)
* <https://www.baeldung.com/keycloak-custom-login-page> (customize the login page)

Pour modifier la page il suffit de copier le style de base (que l’on trouve [ici](https://github.com/keycloak/keycloak/tree/master/themes/src/main/resources/theme/base)), la documentation officielle sur les themes est [ici](https://github.com/keycloak/keycloak-documentation/blob/master/server_development/topics/themes.adoc).

<https://developers.google.com/identity/sign-in/web/build-button>

## **Deployment**

[**https://elements.heroku.com/buttons/mieckert/keycloak-heroku**](https://elements.heroku.com/buttons/mieckert/keycloak-heroku)

### Environment variables

The server configuration is the following…

![](https://lh6.googleusercontent.com/tCjJYtWHv7LoZZTf9cN16ENI8Z25R8h6JTxGbUmR2SPEGmyIvTSoGRwBFpD-zPswRkyE07pxCTW9MjQ5crzATvsw7qt8iZJOVDAJaa0HMkIGH1dWWRpHtbB5nvp4dhnST0m90lx_)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://farci-logan.gitbook.io/journal-de-bord/security/authorization-server-keycloak.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
