Class ServiceAccountAwareSecurityManager
java.lang.Object
com.gigaspaces.security.serviceaccount.ServiceAccountAwareSecurityManager
- All Implemented Interfaces:
SecurityManager
A
SecurityManager wrapper that adds service-account JWT authentication
on top of any legacy SecurityManager (File-based or Spring-based).
Authentication chain (mirrors the ProviderManager pattern in the auth server):
- If the password looks like a JWT → validate signature via auth server JWK endpoint,
extract privilege strings from the
sa_scopeclaim. - Otherwise (or if JWT validation fails) → delegate to the wrapped legacy SecurityManager.
Required configuration properties (in security.properties):
com.gs.security.security-manager.class=com.gigaspaces.security.serviceaccount.ServiceAccountAwareSecurityManager com.gs.security.service-account.delegate-class=com.gigaspaces.security.spring.SpringSecurityManager com.gs.security.service-account.auth-url=http://localhost:9000All other properties (e.g.
spring-security-config-location) are forwarded to the delegate.-
Field Summary
FieldsFields inherited from interface com.gigaspaces.security.SecurityManager
SECURITY_MANAGER_CLASS_PROPERTY_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(UserDetails userDetails) Attempts to authenticate the passed user represented byUserDetails, returning a fully populatedUserDetailsobject (including granted authorities) if successful.voidclose()Closes any excess resource kept by the security manager; e.g.createDirectoryManager(UserDetails userDetails) Attempts to authenticate the passed user represented byUserDetails, granting access only for users that are allowed to manage the directory.voidinit(Properties properties) Initializes this security manager instance with implementation specific properties, and any resource creation/access needed.
-
Field Details
-
DELEGATE_CLASS_PROPERTY
- See Also:
-
AUTH_URL_PROPERTY
- See Also:
-
DEFAULT_AUTH_URL
- See Also:
-
-
Constructor Details
-
ServiceAccountAwareSecurityManager
public ServiceAccountAwareSecurityManager()
-
-
Method Details
-
init
Description copied from interface:SecurityManagerInitializes this security manager instance with implementation specific properties, and any resource creation/access needed.- Specified by:
initin interfaceSecurityManager- Parameters:
properties- properties to use configure this instance.- Throws:
SecurityException
-
authenticate
Description copied from interface:SecurityManagerAttempts to authenticate the passed user represented byUserDetails, returning a fully populatedUserDetailsobject (including granted authorities) if successful.- Specified by:
authenticatein interfaceSecurityManager- Parameters:
userDetails- the user request object- Returns:
- a fully authenticated object including authorities
- Throws:
AuthenticationException- if authentication fails
-
createDirectoryManager
public DirectoryManager createDirectoryManager(UserDetails userDetails) throws AuthenticationException, AccessDeniedException Description copied from interface:SecurityManagerAttempts to authenticate the passed user represented byUserDetails, granting access only for users that are allowed to manage the directory.Creates a directory manager for managing of users and roles, granting access only for users that are allowed to manage, but may be restrictive (to read-only) based on their privileges.
If the directory is to be managed by an external tool, implementors may wish to throw
DirectoryAccessDeniedExceptionto deny access to the API (e.g. from UI).- Specified by:
createDirectoryManagerin interfaceSecurityManager- Parameters:
userDetails- the user request object- Returns:
- a directory manager instance
- Throws:
AuthenticationException- if authentication fails for the specified userAccessDeniedException- if not granted sufficient access required to manage role detailsDirectoryAccessDeniedException- if the directory should not be managed by API.
-
close
public void close()Description copied from interface:SecurityManagerCloses any excess resource kept by the security manager; e.g. connection to a data-source.- Specified by:
closein interfaceSecurityManager
-