Class AuthGrandManipluationUtil

Direct Known Subclasses:
SessionUtil

public class AuthGrandManipluationUtil extends UtilBase
This class holds the authorization grant manipulation utility methods
Author:
Infosys Equinox
  • Field Details

  • 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 - a Long object.
      collection - a CollectionVO object.
      tokenData - an Array of String objects.
      context - a ApplicationContext object.
      authCommonServices - a AuthCommonServices object.
      roleRepository - a RoleRepository 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 of String objects.
      authorizationConfig - a AuthorizationConfig object.
      context - a ApplicationContext objects.
      Returns:
      a Set of String 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 - a Set of String objects.
      roleRepository - a RoleRepository object.
      Returns:
      a List of UserRoleData 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 - a Long object.
      authSessionHandler - a AuthSessionHandler object.
      Returns:
      a AuthGrantedAuthority object.
    • getTokenExpiryTime

      public static Long getTokenExpiryTime(boolean isGuest, Long collectionId, String[] tokenData, org.springframework.context.ApplicationContext context)
    • 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 - a String object.
      collection - a CollectionVO object.
      clientTokenData - an Array of String objects.
      context - a ApplicationContext object.
      authCommonServices - a AuthCommonServices object.
      roleRepository - a RoleRepository 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 - a String object.
      authSessionHandler - a AuthSessionHandler object.
      Returns:
      a AuthGrantedAuthority object.