Class MidpointAuthentication

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
com.evolveum.midpoint.authentication.api.config.MidpointAuthentication
All Implemented Interfaces:
AuthenticationAnonymousChecker, Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class MidpointAuthentication extends org.springframework.security.authentication.AbstractAuthenticationToken implements AuthenticationAnonymousChecker
Authentication token on top of hierarchy. Wrapper for all authentication modules. Contains method and variables for finding out the current status of authentication. Also contains method and variables for easy recovery of authentication flow.
Author:
skublik
See Also:
  • Field Details

    • NO_PROCESSING_MODULE_INDEX

      public static final int NO_PROCESSING_MODULE_INDEX
      See Also:
    • NO_MODULE_FOUND_INDEX

      public static final int NO_MODULE_FOUND_INDEX
      See Also:
  • Constructor Details

  • Method Details

    • getAuthModules

      public List<AuthModule<?>> getAuthModules()
    • setAuthModules

      public void setAuthModules(List<AuthModule<?>> authModules)
    • getSequence

      public AuthenticationSequenceType getSequence()
    • getSequenceIdentifier

      public String getSequenceIdentifier()
    • setSequence

      public void setSequence(AuthenticationSequenceType sequence)
    • getSharedObjects

      public Map<Class<?>,Object> getSharedObjects()
    • setSharedObjects

      public void setSharedObjects(Map<Class<?>,Object> sharedObjects)
    • getAuthenticationChannel

      public AuthenticationChannel getAuthenticationChannel()
    • setAuthenticationChannel

      public void setAuthenticationChannel(AuthenticationChannel authenticationChannel)
    • getAuthentications

      public List<ModuleAuthentication> getAuthentications()
    • addAuthentications

      public void addAuthentications(ModuleAuthentication authentication)
    • getAuthorities

      public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.Authentication
      Overrides:
      getAuthorities in class org.springframework.security.authentication.AbstractAuthenticationToken
    • setAuthorities

      public void setAuthorities(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
    • getCredentials

      public Object getCredentials()
      Specified by:
      getCredentials in interface org.springframework.security.core.Authentication
    • setCredential

      public void setCredential(Object credential)
    • getPrincipal

      public Object getPrincipal()
      Specified by:
      getPrincipal in interface org.springframework.security.core.Authentication
    • setPrincipal

      public void setPrincipal(Object principal)
    • setAuthenticated

      public void setAuthenticated(boolean authenticated)
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      setAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
    • setSessionId

      public void setSessionId(String sessionId)
    • getSessionId

      public String getSessionId()
    • isAuthenticated

      public boolean isAuthenticated()
      Specified by:
      isAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      isAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
    • getIndexOfProcessingModule

      public int getIndexOfProcessingModule(boolean createEmptyAuthenticationIfNeeded)
    • isFinished

      public boolean isFinished()
    • getIndexOfModule

      public int getIndexOfModule(ModuleAuthentication authentication)
    • getProcessingModuleAuthentication

      public ModuleAuthentication getProcessingModuleAuthentication()
    • getProcessingModuleAuthenticationIdentifier

      public String getProcessingModuleAuthenticationIdentifier()
    • isAuthenticationFailed

      public boolean isAuthenticationFailed()
    • isOverLockoutMaxAttempts

      public boolean isOverLockoutMaxAttempts()
    • setOverLockoutMaxAttempts

      public void setOverLockoutMaxAttempts(boolean overLockoutMaxAttempts)
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
      Overrides:
      getName in class org.springframework.security.authentication.AbstractAuthenticationToken
    • getUsername

      public String getUsername()
    • getFailedReason

      public String getFailedReason()
    • getFirstFailedAuthenticationModule

      public ModuleAuthentication getFirstFailedAuthenticationModule()
    • getAuthenticationExceptionIfExists

      public org.springframework.security.core.AuthenticationException getAuthenticationExceptionIfExists()
    • getParallelProcessingModules

      public List<ModuleAuthentication> getParallelProcessingModules()
    • resolveParallelModules

      public int resolveParallelModules(jakarta.servlet.http.HttpServletRequest request, int actualIndex)
    • isLast

      public boolean isLast(ModuleAuthentication moduleAuthentication)
    • isAnonymous

      public boolean isAnonymous()
      Specified by:
      isAnonymous in interface AuthenticationAnonymousChecker
    • hasSucceededAuthentication

      public boolean hasSucceededAuthentication()
    • wrongConfiguredSufficientModuleExists

      public boolean wrongConfiguredSufficientModuleExists()
    • authenticationShouldBeAborted

      public boolean authenticationShouldBeAborted()
    • getProcessingModuleNecessity

      public AuthenticationSequenceModuleNecessityType getProcessingModuleNecessity()
    • resolveSecurityPolicyForPrincipal

      public SecurityPolicyType resolveSecurityPolicyForPrincipal()
    • isAlreadyAudited

      public boolean isAlreadyAudited()
    • setAlreadyAudited

      public void setAlreadyAudited(boolean alreadyAudited)
    • setArchetypeOid

      public void setArchetypeOid(String archetypeOid)
    • getArchetypeOid

      public String getArchetypeOid()
    • setArchetypeSelected

      public void setArchetypeSelected(boolean archetypeSelected)
    • isArchetypeDefined

      public boolean isArchetypeDefined()
    • getProcessingModuleOrThrowException

      public ModuleAuthentication getProcessingModuleOrThrowException()
    • setToken

      public void setToken(org.springframework.security.core.Authentication token)
    • isAlreadyCompiledGui

      public boolean isAlreadyCompiledGui()
    • setAlreadyCompiledGui

      public void setAlreadyCompiledGui(boolean alreadyCompiledGui)
    • restart

      public void restart()
      Restart this authentication, so next request start from one module in authentication sequence.