protected Enumeration getGroups(String username) { try { return this.getRealm().getGroupNames(username); } catch (InvalidOperationException ex) { Logger.getLogger("global").log(Level.SEVERE, null, ex); } catch (NoSuchUserException ex) { Logger.getLogger("global").log(Level.SEVERE, null, ex); } return null; } }
protected Enumeration getGroups(String username) { try { return this.getRealm().getGroupNames(username); } catch (InvalidOperationException ex) { Logger.getLogger("global").log(Level.SEVERE, null, ex); } catch (NoSuchUserException ex) { Logger.getLogger("global").log(Level.SEVERE, null, ex); } return null; } }
public String[] getGroupNames(final String realmName, final String user) { try { return CollectionUtil.toArray(ListUtil.newList( getRealm(realmName).getGroupNames(user) ), String.class); } catch( final Exception e ) { throw new RuntimeException(e); } }
public String[] getGroupNames(final String realmName) { try { final List<String> names = ListUtil.newList( getRealm(realmName).getGroupNames() ); return CollectionUtil.toArray(names, String.class); } catch( final Exception e ) { throw new RuntimeException(e); } }
public static Subject jmacLogin(Subject subject, String identityAssertion, String realm) throws LoginException { if (subject == null) { subject = new Subject(); } final Subject fs = subject; String userName = identityAssertion; try { if (realm == null || "".equals(realm)) { realm = Realm.getDefaultRealm(); } Realm realmInst = Realm.getInstance(realm); final Enumeration groups = realmInst.getGroupNames(userName); if (groups != null && groups.hasMoreElements()) { AppservAccessController.doPrivileged(new PrivilegedAction() { public java.lang.Object run() { while (groups.hasMoreElements()) { String grp = (String) groups.nextElement(); fs.getPrincipals().add(new Group(grp)); } return fs; } }); } } catch (Exception ex) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Exception when trying to populate groups for CallerPrincipal " + identityAssertion, ex); } } return subject; }
public static Subject jmacLogin(Subject subject, String identityAssertion, String realm) throws LoginException { if (subject == null) { subject = new Subject(); } final Subject fs = subject; String userName = identityAssertion; try { if (realm == null || "".equals(realm)) { realm = Realm.getDefaultRealm(); } Realm realmInst = Realm.getInstance(realm); final Enumeration groups = realmInst.getGroupNames(userName); if (groups != null && groups.hasMoreElements()) { AppservAccessController.doPrivileged(new PrivilegedAction() { public java.lang.Object run() { while (groups.hasMoreElements()) { String grp = (String) groups.nextElement(); fs.getPrincipals().add(new Group(grp)); } return fs; } }); } } catch (Exception ex) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Exception when trying to populate groups for CallerPrincipal " + identityAssertion, ex); } } return subject; }
Enumeration en = realm.getGroupNames(username); Set<Principal> principalSet = s.getPrincipals(); while (en.hasMoreElements()) {
Enumeration en = realm.getGroupNames(username); Set<Principal> principalSet = s.getPrincipals(); while (en.hasMoreElements()) {