User Role Management APIs LDAP Resource

Resource allows reading and updating LDAP settings.

Get LDAP attributes

get

Retrieve the LDAP attributes of the repository.

Example Request:

GET pentaho/api/ldap/config/getAttributeValues

cURL Example:

curl -X GET \
  "http://localhost:8080/pentaho/api/ldap/config/getAttributeValues" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -H "Accept: application/json"

Example Response:

{
  "attributes": [
    {
      "key": "allAuthoritiesSearch.searchBase",
      "value": "ou=roles"
    },
    {
      "key": "allUsernamesSearch.searchBase",
      "value": "ou=users"
    },
    {
      "key": "userSearch.searchFilter",
      "value": "(cn={0})"
    },
    {
      "key": "securityProvider",
      "value": "jackrabbit"
    },
    {
      "key": "populator.groupRoleAttribute",
      "value": "cn"
    },
    {
      "key": "allUsernamesSearch.usernameAttribute",
      "value": "uid"
    },
    {
      "key": "populator.groupSearchBase",
      "value": "ou=roles"
    },
    {
      "key": "contextSource.providerUrl",
      "value": "ldap://localhost:10389/ou=system"
    },
    {
      "key": "populator.searchSubtree",
      "value": "false"
    },
    {
      "key": "allUsernamesSearch.searchFilter",
      "value": "objectClass=Person"
    },
    {
      "key": "populator.convertToUpperCase",
      "value": "false"
    },
    {
      "key": "populator.rolePrefix",
      "value": ""
    },
    {
      "key": "contextSource.password",
      "value": "secret"
    },
    {
      "key": "userSearch.searchBase",
      "value": "ou=users"
    },
    {
      "key": "allAuthoritiesSearch.roleAttribute",
      "value": "cn"
    },
    {
      "key": "adminUser",
      "value": "uid=admin,ou=users"
    },
    {
      "key": "contextSource.userDn",
      "value": "uid=admin,ou=system"
    },
    {
      "key": "allAuthoritiesSearch.searchFilter",
      "value": "(objectClass=organizationalRole)"
    },
    {
      "key": "populator.groupSearchFilter",
      "value": "(roleOccupant={0})"
    },
    {
      "key": "adminRole",
      "value": "cn=Administrator,ou=roles"
    }
  ]
}

Returns: An AttributeSet object containing LDAP attributes of the repository.

Authorizations
Responses
200

Successfully retrieved the LDAP attributes of the repository

application/json
get
/ldap/config/getAttributeValues
GET /ldap/config/getAttributeValues HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
{
  "attributes": [
    {
      "key": "text",
      "value": "text"
    }
  ]
}

Set LDAP attributes

put

Writes LDAP attributes with new authentication parameters.

Example Request:

PUT pentaho/api/ldap/config/setAttributeValues

PUT data:

{
  "attributes": [
    {
      "key": "allAuthoritiesSearch.searchBase",
      "value": "ou=roles"
    },
    {
      "key": "allUsernamesSearch.searchBase",
      "value": "ou=users"
    },
    {
      "key": "userSearch.searchFilter",
      "value": "(cn={0})"
    },
    {
      "key": "securityProvider",
      "value": "jackrabbit"
    },
    {
      "key": "populator.groupRoleAttribute",
      "value": "cn"
    },
    {
      "key": "allUsernamesSearch.usernameAttribute",
      "value": "uid"
    },
    {
      "key": "populator.groupSearchBase",
      "value": "ou=roles"
    },
    {
      "key": "contextSource.providerUrl",
      "value": "ldap://localhost:10389/ou=system"
    },
    {
      "key": "populator.searchSubtree",
      "value": "false"
    },
    {
      "key": "allUsernamesSearch.searchFilter",
      "value": "objectClass=Person"
    },
    {
      "key": "populator.convertToUpperCase",
      "value": "false"
    },
    {
      "key": "populator.rolePrefix",
      "value": ""
    },
    {
      "key": "contextSource.password",
      "value": "secret"
    },
    {
      "key": "userSearch.searchBase",
      "value": "ou=users"
    },
    {
      "key": "allAuthoritiesSearch.roleAttribute",
      "value": "cn"
    },
    {
      "key": "adminUser",
      "value": "uid=admin,ou=users"
    },
    {
      "key": "contextSource.userDn",
      "value": "uid=admin,ou=system"
    },
    {
      "key": "allAuthoritiesSearch.searchFilter",
      "value": "(objectClass=organizationalRole)"
    },
    {
      "key": "populator.groupSearchFilter",
      "value": "(roleOccupant={0})"
    },
    {
      "key": "adminRole",
      "value": "cn=Administrator,ou=roles"
    }
  ]
}

cURL Example:

curl -X PUT \
  "http://localhost:8080/pentaho/api/ldap/config/setAttributeValues" \
  -H "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" \
  -H "Content-Type: application/json" \
  -d '{
    "attributes": [
      {
        "key": "allAuthoritiesSearch.searchBase",
        "value": "ou=roles"
      },
      {
        "key": "allUsernamesSearch.searchBase",
        "value": "ou=users"
      }
    ]
  }'

Example Response:

This response does not contain data.

Returns: A jax-rs Response object with the appropriate status code, header, and body.

Authorizations
Body
Responses
200

Successfully updated the LDAP attributes of the repository

No content

put
/ldap/config/setAttributeValues
PUT /ldap/config/setAttributeValues HTTP/1.1
Host: 
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "attributes": [
    {
      "key": "text",
      "value": "text"
    }
  ]
}

No content

Was this helpful?