Jenkins - Plugin Keycloak (securityRealm and authorizationStrategy)


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:

    defaultConfig: true
    securityRealm: |-
        allowsSignup: false
        enableCaptcha: false
        - id: "${chart-admin-username}"
          name: "Jenkins Admin"
          password: "${chart-admin-password}"
        - id: "TEST"
          name: "TEST"
          - "apiToken"
          - favoriting:
              autofavoriteEnabled: true
          - "favorite"
          - preferredProvider:
              providerId: "default"
          - "timezone"
          - mailer:
              emailAddress: ""
    authorizationStrategy: |-
        - "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)

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