Package com.skava.auth.util
Class AuthGrandManipluationUtil
java.lang.Object
com.skava.auth.util.JavaCollectionUtil
com.skava.auth.util.UtilBase
com.skava.auth.util.AuthGrandManipluationUtil
- Direct Known Subclasses:
SessionUtil
This class holds the authorization grant manipulation utility methods
- Author:
- Infosys Equinox
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.skava.core.auth.AuthGrantedAuthority
getAuthorityFromCache
(Long userId, AuthSessionHandler authSessionHandler) This method returns the authority from the cache by user identifier.static com.skava.core.auth.AuthGrantedAuthority
getAuthorityGrant
(Long userId, CollectionVO collection, String[] tokenData, org.springframework.context.ApplicationContext context, AuthCommonServices authCommonServices, RoleRepository roleRepository, boolean skipPrivilegeForStandardRole) This method returns the authorization service granted authority based on user's role association.static com.skava.core.auth.AuthGrantedAuthority
getClientAuthorityFromCache
(String clientId, AuthSessionHandler authSessionHandler) This method returns the authority from the cache by user identifier.static com.skava.core.auth.AuthGrantedAuthority
getClientAuthorityGrant
(String clientId, CollectionVO collection, String[] clientTokenData, org.springframework.context.ApplicationContext context, AuthCommonServices authCommonServices, RoleRepository roleRepository, boolean skipPrivilegeForStandardRole) This method returns the authorization service granted authority based on clients's role association.getGranterRolesFromRolePrivilegeMapper
(String[] tokenData, AuthorizationConfig authorizationConfig, SSOAuthRolePrivilegeMapper sSOAuthRolePrivilegeMapper) getSSOGrantedRoles
(String[] tokenData, AuthorizationConfig authorizationConfig, org.springframework.context.ApplicationContext context) This method returns the SSO granted role names.static List<com.skava.core.auth.model.UserRoleData>
getSSORoles
(Set<String> grantedRoles, RoleRepository roleRepository) THis method returns the list of user role data based on sso roles.static Long
getTokenExpiryTime
(boolean isGuest, Long collectionId, String[] tokenData, org.springframework.context.ApplicationContext context) Methods inherited from class com.skava.auth.util.UtilBase
getAuthentication, getAuthenticationToken, getBean, getClientAuthenticationToken, getClientAuthenticationTokenBase, getCurrentTimeInMillis, resourceNotFoundException, validateClientId, validateCollectionId, validateUserId, validationException
Methods inherited from class com.skava.auth.util.JavaCollectionUtil
convertToList, getNewList, getNewSet, hasSingleKey
-
Field Details
-
DEFAULT_ACCOUNT_ID
protected static final long DEFAULT_ACCOUNT_ID- See Also:
-
SSO_BEARER_TOKEN_SIZE
protected static final int SSO_BEARER_TOKEN_SIZE- See Also:
-
SSO_AUTHORIZATION_DATA_INDEX
protected static final int SSO_AUTHORIZATION_DATA_INDEX- See Also:
-
DEFAULT_ROLE_SERVICE
- See Also:
-
DEFAULT_ROLE_TYPE
- See Also:
-
CUSTOM_ROLE_TYPE
- See Also:
-
SSO_TYPE_INDEX
protected static final int SSO_TYPE_INDEX- See Also:
-
-
Constructor Details
-
AuthGrandManipluationUtil
protected AuthGrandManipluationUtil()default constructor
-
-
Method Details
-
getAuthorityGrant
public static com.skava.core.auth.AuthGrantedAuthority getAuthorityGrant(Long userId, CollectionVO collection, String[] tokenData, org.springframework.context.ApplicationContext context, AuthCommonServices authCommonServices, RoleRepository roleRepository, boolean skipPrivilegeForStandardRole) This method returns the authorization service granted authority based on user's role association.- Parameters:
userId
- aLong
object.collection
- aCollectionVO
object.tokenData
- an Array ofString
objects.context
- aApplicationContext
object.authCommonServices
- aAuthCommonServices
object.roleRepository
- aRoleRepository
object.skipPrivilegeForStandardRole
-Boolean
object.- Returns:
- a
AuthGrantedAuthority
object.
-
getSSOGrantedRoles
public static Set<String> getSSOGrantedRoles(String[] tokenData, AuthorizationConfig authorizationConfig, org.springframework.context.ApplicationContext context) This method returns the SSO granted role names.- Parameters:
tokenData
- an Array ofString
objects.authorizationConfig
- aAuthorizationConfig
object.context
- aApplicationContext
objects.- Returns:
- a
Set
ofString
objects.
-
getGranterRolesFromRolePrivilegeMapper
public static Set<String> getGranterRolesFromRolePrivilegeMapper(String[] tokenData, AuthorizationConfig authorizationConfig, SSOAuthRolePrivilegeMapper sSOAuthRolePrivilegeMapper) -
getSSORoles
public static List<com.skava.core.auth.model.UserRoleData> getSSORoles(Set<String> grantedRoles, RoleRepository roleRepository) THis method returns the list of user role data based on sso roles.- Parameters:
grantedRoles
- aSet
ofString
objects.roleRepository
- aRoleRepository
object.- Returns:
- a
List
ofUserRoleData
objects.
-
getAuthorityFromCache
public static com.skava.core.auth.AuthGrantedAuthority getAuthorityFromCache(Long userId, AuthSessionHandler authSessionHandler) This method returns the authority from the cache by user identifier.- Parameters:
userId
- aLong
object.authSessionHandler
- aAuthSessionHandler
object.- Returns:
- a
AuthGrantedAuthority
object.
-
getTokenExpiryTime
-
getClientAuthorityGrant
public static com.skava.core.auth.AuthGrantedAuthority getClientAuthorityGrant(String clientId, CollectionVO collection, String[] clientTokenData, org.springframework.context.ApplicationContext context, AuthCommonServices authCommonServices, RoleRepository roleRepository, boolean skipPrivilegeForStandardRole) This method returns the authorization service granted authority based on clients's role association.- Parameters:
clientId
- aString
object.collection
- aCollectionVO
object.clientTokenData
- an Array ofString
objects.context
- aApplicationContext
object.authCommonServices
- aAuthCommonServices
object.roleRepository
- aRoleRepository
object.skipPrivilegeForStandardRole
-Boolean
object.- Returns:
- a
AuthGrantedAuthority
object.AuthCommonServices
-
getClientAuthorityFromCache
public static com.skava.core.auth.AuthGrantedAuthority getClientAuthorityFromCache(String clientId, AuthSessionHandler authSessionHandler) This method returns the authority from the cache by user identifier.- Parameters:
clientId
- aString
object.authSessionHandler
- aAuthSessionHandler
object.- Returns:
- a
AuthGrantedAuthority
object.
-