java - Getting all ActiveDirectory groups using OpenSSO Client SDK -


I hope someone has the experience of Sun OpenSSO (now ForgeRock OpenM) here.

I am trying to get all the groups in Active Directory using the OpenSSO client SDK in Java / Jabs EAP 5.0.

I tried to combine different specimens and code snippets found on the web, but it failed, and ultimately the log "is not permitted for membership other than users." Basic approach AMIdentityRepository -> getRealmIdentity () -> getMemberships (IdType.GROUP) was to use:

  SSOTokenManager manager = SSOTokenManager.getInstance (); String token string = URLDecoder.decode (TokenID, "ISO-8859-1"); SSotoken token = manager.createSotoken (tokenString); If (manager.isValidToken (token)) {SSOToken adminToken = (SSotoken) AccessController doPrivileged (AdminTokenAction.getInstance ()); AMIdentityRepository rep = New AMIdentityRepository (adminToken, "/"); Common Identity = Rep. Set up groups = identity.getMemberships (IdType.GROUP); }  

Note that I am not trying to determine whether a user is a member of the group or to retrieve the user's group - I get the list of all groups I am trying.

Any suggestions would be appreciated - Thanks!

Instead call rep.getRealmIdentity () and then the matching posts (idtipp.gruup) Use search ads and search. Results like:

  SSotoken token = (SSotoken) AccessController.doPrivileged (AdminTokenAction.getInstance ()); AMIdentityRepository ir = New AMIdentityRepository (token, "/"); IdSearchResults Results = ir.searchIdentities (IdType.GROUP, "*", New IdSearchControl ()); Set up & lt; AMIdentity & gt; Groups = results.getSearchResults (); (AMIdentity Group: Groups) {logger.debug ("Group name:" + group.getName ()); }  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -