Class AccessService

java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.AccessService
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Service public class AccessService extends ServiceConfig
Manage application accesses
  • Field Details

  • Constructor Details

    • AccessService

      public AccessService(AweSessionDetails sessionDetails, MenuService menuService, EncodeService encodeService, TotpService totpService, BaseConfigProperties baseConfigProperties, SecurityConfigProperties securityConfigProperties, TotpConfigProperties totpConfigProperties, AweUserDetailService aweUserDetailService, MaintainService maintainService)
      AccessService constructor
      Parameters:
      menuService - Menu service
      sessionDetails - Session details
      encodeService - Encode services
      totpService - Totp service
      baseConfigProperties - Base configuration properties
      securityConfigProperties - Security configuration properties
      totpConfigProperties - Totp configuration properties
      aweUserDetailService - Awe user details
      maintainService - Maintain service
  • Method Details

    • login

      public ServiceData login() throws AWException
      Performs the login action
      Returns:
      serviceData the result of the login
      Throws:
      AWException - Error generating login
    • loginWithAzureEntraID

      public ServiceData loginWithAzureEntraID()
      Azure EntraID redirection
      Returns:
      do send redirect to Azure oauth portal
    • onAuthenticationSuccess

      public String onAuthenticationSuccess(org.springframework.security.oauth2.core.user.DefaultOAuth2User oauth2User) throws AWException
      Manage Oauth success authentication
      Parameters:
      oauth2User - Oauth2 user info
      Returns:
      initial screen url for redirection
      Throws:
      AWException - AWE exception
    • verify2faCode

      public ServiceData verify2faCode(String code) throws AWException
      Retrieve QR Code in PNG format as String
      Returns:
      QR Code as string
      Throws:
      AWException
    • logout

      public ServiceData logout()
      Performs the logout action
      Returns:
      serviceData the result of the login
    • isAuthenticated

      public boolean isAuthenticated() throws AWException
      Check if user is authenticated
      Returns:
      User is authenticated
      Throws:
      AWException - Error checking authentication
    • getProfileNameFileList

      public ServiceData getProfileNameFileList()
      Get profile restriction list
      Returns:
      Profile restriction file list
    • encryptText

      public ServiceData encryptText(String textToEncrypt, String phraseKey) throws AWException
      Encrypts a text parameter with algorithm RipEmd160
      Parameters:
      textToEncrypt - text to encrypt
      phraseKey - phrase key
      Returns:
      Service Data with text encrypted
      Throws:
      AWException - Error
    • encryptProperty

      public ServiceData encryptProperty(String textToEncrypt, String phraseKey)
      Encrypts a text parameter with algorithm RipEmd160
      Parameters:
      textToEncrypt - text to encrypt
      phraseKey - phrase key
      Returns:
      Service Data with text encrypted