Package com.gigaspaces.security.service
Class SecurityInterceptor
java.lang.Object
com.gigaspaces.security.service.SecurityInterceptor
Server-side security interceptor, responsible for authentication against the underlying
SecurityManager, handing of authentication tokens to authenticated users, and intercepting any
access to resources.- Since:
- 7.0.1
- Author:
- Moran Avigdor
-
Constructor Summary
ConstructorsConstructorDescriptionSecurityInterceptor(String component) SecurityInterceptor(String component, Properties props, boolean useMinusDLast) Construct an interceptor for this component, applying any additional properties provided. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(SecurityContext securityContext) Authenticates the users' details (username and password) specified as part of the security-context against the underlyingSecurityManager.getUserDetails(AuthenticationToken authenticationToken) Retrieve user details by the authentication token to allow login into first-time cluster member proxies.voidintercept(SecurityContext securityContext, Privilege privilege, String className) Intercepts any requests against the provided authentication token and the privilege needed to access the resource.booleanisTrusted(UserDetails userDetails) booleanshouldBypassFilter(SecurityContext securityContext) If security context should not be passed to the filter or audit.trustContext(SpaceContext spaceContext) Extract the original security context and create a trusted security context wrapper.voidtrustProxy(IJSpace proxy) Internal (VM) trust mechanism; acquires a trusted token and sets the internal proxy.
-
Constructor Details
-
SecurityInterceptor
-
SecurityInterceptor
Construct an interceptor for this component, applying any additional properties provided. ASecurityManagercan be injected through this properties object.- Parameters:
component- component name (can be null)props- custom properties provided.useMinusDLast-trueif should first find security properties file matching the component name, and if not found, resolve by matching the sys-prop provided name. Usually when running inside a container.falseif should first resolve by matching the sys-prop provided name.
-
-
Method Details
-
authenticate
Authenticates the users' details (username and password) specified as part of the security-context against the underlyingSecurityManager. An authenticated user is given a token for subsequent usage. Audit successful/failed authentication requests.- Parameters:
securityContext- The security context holding the user details.- Returns:
- an authenticated security context holding the authentication token.
-
isTrusted
-
trustProxy
Internal (VM) trust mechanism; acquires a trusted token and sets the internal proxy.- Throws:
RemoteException
-
intercept
Intercepts any requests against the provided authentication token and the privilege needed to access the resource.- Parameters:
privilege- The privilege required to access the resource.className- The class name to intercept if an operation filter was provided.- Throws:
AuthenticationException- if the authentication token provided is invalid.AccessDeniedException- if the authenticated user lacks privileges required by the accessed resource.
-
getUserDetails
Retrieve user details by the authentication token to allow login into first-time cluster member proxies.- Parameters:
authenticationToken- a token- Returns:
- the user details corresponding to this token.
- Throws:
AuthenticationException- if the authentication token is invalid.
-
trustContext
Extract the original security context and create a trusted security context wrapper.- Parameters:
spaceContext- The space context- Returns:
- a space context holding a trusted security context wrapping the original security context.
-
shouldBypassFilter
If security context should not be passed to the filter or audit.- Returns:
- true if should bypass the filter.
-