# Jenkins - Plugin Keycloak (securityRealm and authorizationStrategy)

**URL:** <https://community.jenkins.io/t/jenkins-plugin-keycloak-securityrealm-and-authorizationstrategy/9162>\
**Category:** Using Jenkins\
**Tags:** jenkinsfile\
**Created:** [August 22, 2023, 5:32pm UTC](https://community.jenkins.io/t/jenkins-plugin-keycloak-securityrealm-and-authorizationstrategy/9162 "2023-08-22T17:32:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diogosilva](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@diogosilva](https://community.jenkins.io/u/diogosilva)\
**Post date:** [August 22, 2023, 5:32pm UTC](https://community.jenkins.io/t/jenkins-plugin-keycloak-securityrealm-and-authorizationstrategy/9162/1 "2023-08-22T17:32:55Z")

</div>

Hi,

I need some help, I’ve tried some configurations but all failed.

I currently run Jenkins in helm _YAML_ file using the following **securityRealm** and **authorizationStrategy** configuration:

```auto
  JCasC:
    defaultConfig: true
    securityRealm: |-
      local:
        allowsSignup: false
        enableCaptcha: false
        users:
        - id: "${chart-admin-username}"
          name: "Jenkins Admin"
          password: "${chart-admin-password}"
        - id: "TEST"
          name: "TEST"
          properties:
          - "apiToken"
          - favoriting:
              autofavoriteEnabled: true
          - "favorite"
          - preferredProvider:
              providerId: "default"
          - "timezone"
          - mailer:
              emailAddress: "email@doamin.com"
    authorizationStrategy: |-
      projectMatrix:
        permissions:
        - "Overall/Administer:admin"
        - "Overall/Read:TEST"

```

This configuration is working perfectly.

But I’m deploying Keycloak as an access centralizer. Performing the configuration in the console it is working perfectly.

The following **keycloak** and **role-strategy** plugins have been installed. (part 1)

As evidenced above, the Security Realm was changed to “_ **Keycloak Authentication Plugin** _” and it would be necessary to add the _JSON_ for communication with Keycloak. (Part 2)

In Authorization it would be necessary to switch to “_ **Role-Based Strategy** _”.

After this configuration, it would be necessary to configure the “ **Manage and Assign Roles** ” as shown in the image below, the creation of “ **Global Roles** ” and “ **Item Roles** ” in addition to “ **Assing Roles** ” (Part 3)

 ![TESTE](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/8/859b1ab02033fcea725fa2a6772d97e53c5d80ee.png)

Could you please help how to pass this information held in the console to the Jenkins YAML?

Thanks

---

<div class="post-metadata">

**Author:** ![abhi-atpl](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/abhi-atpl/32/12649_2.png) [@abhi-atpl](https://community.jenkins.io/u/abhi-atpl)\
**Post date:** [January 13, 2025, 6:10am UTC](https://community.jenkins.io/t/jenkins-plugin-keycloak-securityrealm-and-authorizationstrategy/9162/2 "2025-01-13T06:10:27Z")

</div>

Hi Team, Can any one explain me the detailed steps to integrate jenkins with keycloak SSO along with roles used in keycloak to ensure user get valid permissions.  
This would be great helpful. I have used ‘OpenID Connect Provider’ plugin but I am not getting permissions to login into the jenkins using SSO.
