Member-only story
Integrating Keycloak SSO with Jenkins

Hi Folks! This is a tutorial explaining the Keycloak SSO integration procedure with the Jenkins server. If you don’t have any idea about the Jenkins or Keycloak and SSO terms, I would suggest you take a look at my previous articles explaining SSO terms, Keycloak Server, and Jenkins Server. By taking a read at those two articles, you can get an idea about SSO technologies, Keycloak server, and Jenkins which are very important to this tutorial but will not be explained in this context. So Let’s dig into the tutorial.
Note: I have installed Keycloak Server and Jenkins on the EC2 computer engine.
In order to install the Keycloak Server and Jenkins follow the below links
- * Keycloak → https://github.com/supunsandeeptha/DevOps/blob/master/bootstartp-scripts/Ubuntu/install-keycloak.sh
- * Jenkins →https://medium.com/faun/how-to-install-jenkins-on-ubuntu-18-37f4daad1014
- Create a Realm in Keycloak

By default, the master realm will be there. The master realm has access to all other realms. Therefore, I recommend creating a new realm.

In this use-case, I’ve created a security realm for the test environment.
2. Create a client in the Realm
If you’re expecting to integrate a client with Keycloak, you’re required to create a client. So Let’s create a client for Jenkins. You can use any client-Id, client protocol should be OpenID-connect and you can use the Jenkins server public IP address as the root server URL.

3. Generating the Keycloak Installation JSON
once you create the client, you have to generate the keycloak JSON in order to use it with the later stages of this tutorial (using with the Keycloak plugin with…