Can’t read object over REST API

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  Enrico.gulfi 2 months ago.

  • Author
    Posts
  • #19110
     Enrico.gulfi 
    Participant

    I’m testing OpenDJ REST interface and for that purpose I’ve modified the json config file under opendj/config/rest2ldap/endpoints/api to reflect my DN:

    ...
    "subResources": {
                    "users": {
                        "type": "collection",
                        "dnTemplate": "ou=people,dc=lugano,dc=ch",
                        "resource": "frapi:opendj:rest2ldap:user:1.0",
                        "namingStrategy": {
                            "type": "clientDnNaming",
                            "dnAttribute": "uid"
                        }
                    },
                    "groups": {
                        "type": "collection",
                        "dnTemplate": "ou=groups,dc=lugano,dc=ch",
                        "resource": "frapi:opendj:rest2ldap:group:1.0",
                        "namingStrategy": {
                            "type": "clientDnNaming",
                            "dnAttribute": "cn"
                        }
                    }
    }
    ...

    Then I added person object with the following LDIF:

    dn: cn=Mario Rossi,ou=people,dc=lugano,dc=ch
    objectClass: top
    objectClass: inetOrgPerson
    objectClass: organizationalPerson
    objectClass: person
    mail: mario.rossi@myorg.com
    sn: Rossi
    cn: Mario Rossi
    givenName: Mario
    employeeNumber: 36349
    uid: mario.rossi

    When I try to access it with URL https://localhost:8443/api/users/mario.rossi I get the following error:

    {
    "code": 404,
    "reason": "Not Found",
    "message": "No Such Entry: The search base entry 'uid=mario.rossi,ou=people,dc=lugano,dc=ch' does not exist"
    }

    Any suggestion on how to fix it?

    Thanks in advance, Enrico

    #19111
     JnRouvignac 
    Participant

    Hello,

    The DN of the entry is cn=Mario Rossi,ou=people,dc=lugano,dc=ch, but your configuration points rest2ldap to search for uid=mario.rossi,ou=people,dc=lugano,dc=ch. You can see these are different names.

    Try a URL like this: https://localhost:8443/api/users?_queryFilter=uid+eq+"mario.rossi"&_prettyPrint=true

    Cheers,
    Jean-Noel

    #19113
     Enrico.gulfi 
    Participant

    Many thanks Jean-Noel,

    it looks better as now I’m getting a HTTP 200 OK but the body contains the following:

    {
      "result" : [ ],
      "resultCount" : 0,
      "pagedResultsCookie" : null,
      "totalPagedResultsPolicy" : "NONE",
      "totalPagedResults" : -1,
      "remainingPagedResults" : -1
    }

    Still no information on the requested object :-(

    Enrico

    #19128
     Enrico.gulfi 
    Participant

    OK, solved.

    I had to change the person dn to uid=mario.rossi,ou=people,dc=lugano,dc=ch to make it work.

    Greetings, Enrico

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

©2017 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?