Server-Side Authentication (Groovy)

This topic contains 2 replies, has 2 voices, and was last updated by  srinath.m 3 days, 22 hours ago.

  • Author
    Posts
  • #24057
     Tom.Mazur 
    Participant

    Trying to get the groups that a user is a member of within script module

    String[] memberOf = idRepository.getAttribute(username,”memberOf”);

    for (String m : memberOf) {
    logger.message(“memberof : ” + m);
    }

    Suggestions?

    #24067
     Tom.Mazur 
    Participant

    answer:

    String memberOf = idRepository.getAttribute(username,”memberOf”);
    logger.message(“memberOf : ” + memberOf );

    #24145
     srinath.m 
    Participant

    Hi Tom,

    For our usecase, we get an array of values for memberOf attribute.
    Below is the REST API we use to get values of isMemberOf

    Request : http://openam.example.com/openam/json/users/srinath?_fields=isMemberOf

    Response:

    {
    	"isMemberOf": ["cn=SITE_ADMIN,ou=Roles,ou=applications,ou=groups,dc=example,dc=com", "cn=TEST_ADMIN,ou=networkLabUnits,ou=applications,ou=groups,dc=example,dc=com", "cn=TEST_SG,ou=networkLabUnits,ou=applications,ou=groups,dc=example,dc=com"]
    }
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

©2018 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?