Server-Side Authentication (Groovy)

This topic contains 3 replies, has 2 voices, and was last updated by  Tom.Mazur 7 months, 2 weeks ago.

  • Author
  • #24057

    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);




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


    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 :


    	"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"]

    Excellent! We ended up writing a custom auth module because we wanted customized messages returned based off the isMemberOf value. Are you aware of any way to do that within the groovy script?

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

You must be logged in to reply to this topic.

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