use of org.jboss.security.SimpleGroup in project wildfly by wildfly.
the class AddRoleLoginModule method getRoleSets.
@Override
protected Group[] getRoleSets() throws LoginException {
Group roles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
roles.addMember(new SimplePrincipal(role));
return new Group[] { roles };
}
use of org.jboss.security.SimpleGroup in project wildfly by wildfly.
the class CustomLoginModule method getRoleSets.
/**
* Returns Roles and CallerPrincipal groups. The Roles group contains role defined as login module option. The
* CallerPrincipal contains {@link CustomPrincipal} instance with fixed name {@value #CALLER_NAME}.
*
* @return
* @throws LoginException
* @see org.jboss.security.auth.spi.AbstractServerLoginModule#getRoleSets()
*/
@Override
protected Group[] getRoleSets() throws LoginException {
try {
Group roles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
roles.addMember(new SimplePrincipal(role));
Group callerPrincipal = new SimpleGroup(SecurityConstants.CALLER_PRINCIPAL_GROUP);
callerPrincipal.addMember(new CustomPrincipal(CALLER_NAME));
return new Group[] { roles, callerPrincipal };
} catch (Exception e) {
throw new LoginException(e.toString());
}
}
use of org.jboss.security.SimpleGroup in project wildfly by wildfly.
the class GuestDelegationLoginModule method getRoleSets.
@Override
protected Group[] getRoleSets() throws LoginException {
Group roles = new SimpleGroup("Roles");
Group callerPrincipal = new SimpleGroup("CallerPrincipal");
Group[] groups = { roles, callerPrincipal };
callerPrincipal.addMember(getIdentity());
return groups;
}
use of org.jboss.security.SimpleGroup in project wildfly by wildfly.
the class RealmDirectLoginModule method getRoleSets.
@Override
protected Group[] getRoleSets() throws LoginException {
Collection<Principal> principalCol = new HashSet<Principal>();
principalCol.add(new RealmUser(getUsername()));
try {
AuthorizingCallbackHandler callbackHandler = getCallbackHandler();
SubjectUserInfo sui = callbackHandler.createSubjectUserInfo(principalCol);
SimpleGroup sg = new SimpleGroup("Roles");
Set<RealmRole> roles = sui.getSubject().getPrincipals(RealmRole.class);
for (RealmRole current : roles) {
sg.addMember(createIdentity(current.getName()));
}
return new Group[] { sg };
} catch (Exception e) {
throw SecurityLogger.ROOT_LOGGER.failureCallingSecurityRealm(e.getMessage());
}
}
use of org.jboss.security.SimpleGroup in project wildfly by wildfly.
the class RemotingLoginModule method getRoleSets.
@Override
protected Group[] getRoleSets() throws LoginException {
Group roles = new SimpleGroup("Roles");
Group callerPrincipal = new SimpleGroup("CallerPrincipal");
Group[] groups = { roles, callerPrincipal };
callerPrincipal.addMember(getIdentity());
return groups;
}
Aggregations