org.jboss.soa.esb.services.security
Interface SecurityService


public interface SecurityService

This interface represents a Security service.

Since:
4.4
Author:
Daniel Bevenius

Field Summary
static java.lang.String AUTH_REQUEST
           
static java.lang.String CONTEXT
          Constant intended for usage as a key in different types of maps.
 
Method Summary
 void authenticate(SecurityConfig securityConfig, SecurityContext securityContext, AuthenticationRequest authRequest)
          Authenticates a subject.
 boolean checkRolesAllowed(java.util.List<java.lang.String> rolesAllowed, SecurityContext securityContext)
          Check if the the SecurityContext has a principal that is a member of one of the passed in rolesAllowed list.
 void configure()
          Configure the security serivce for usage.
 boolean isCallerInRole(javax.security.auth.Subject subject, java.security.Principal role)
          Determines if the subject contains the passed in role in it's set of Principals.
 void logout(SecurityConfig securityConfig)
          Logout and clean up of any security state.
 void refreshSecurityConfig()
          Refresh the security configuration
 

Field Detail

CONTEXT

static final java.lang.String CONTEXT
Constant intended for usage as a key in different types of maps.

See Also:
Constant Field Values

AUTH_REQUEST

static final java.lang.String AUTH_REQUEST
See Also:
Constant Field Values
Method Detail

configure

void configure()
               throws ConfigurationException
Configure the security serivce for usage. This should take care of reading any needed configurations required by the security system.

Throws:
ConfigurationException

authenticate

void authenticate(SecurityConfig securityConfig,
                  SecurityContext securityContext,
                  AuthenticationRequest authRequest)
                  throws SecurityServiceException
Authenticates a subject.

Parameters:
securityContext - - the security context to authenticate
Throws:
javax.security.auth.login.LoginException - - if the authentication was not sucessful
SecurityServiceException

checkRolesAllowed

boolean checkRolesAllowed(java.util.List<java.lang.String> rolesAllowed,
                          SecurityContext securityContext)
Check if the the SecurityContext has a principal that is a member of one of the passed in rolesAllowed list.

Parameters:
rolesAllowed - - list or allowed roles
securityContext - - the security context
Returns:
true - if the SecurityContext has a principal that is a member of one the roles.

isCallerInRole

boolean isCallerInRole(javax.security.auth.Subject subject,
                       java.security.Principal role)
Determines if the subject contains the passed in role in it's set of Principals.

Parameters:
subject - - the Subject instance belonging to the caller.
context - - the principal instance representing the role to check for.
Returns:
true - if the caller has the role of

logout

void logout(SecurityConfig securityConfig)
Logout and clean up of any security state.

Parameters:
securityContext -
Throws:
javax.security.auth.login.LoginException

refreshSecurityConfig

void refreshSecurityConfig()
Refresh the security configuration