Interface CurrentUserSubstitution

All Known Implementing Classes:
CurrentUserSubstitutionImpl

public interface CurrentUserSubstitution
Interface is used to get the information about current user substitution
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.core.userdetails.UserDetails
    Method returns currently authenticated user (the user who actually logged in).
    org.springframework.security.core.userdetails.UserDetails
    Method returns currently authenticated user (the user who actually logged in).
    org.springframework.security.core.userdetails.UserDetails
    Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwise
    org.springframework.security.core.userdetails.UserDetails
    Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwise.
    org.springframework.security.core.userdetails.UserDetails
    Method returns the substituted user or null if user substitution didn't happen.
    org.springframework.security.core.userdetails.UserDetails
    Method returns the substituted user or null if user substitution didn't happen.
  • Method Details

    • getAuthenticatedUser

      org.springframework.security.core.userdetails.UserDetails getAuthenticatedUser()
      Method returns currently authenticated user (the user who actually logged in). The fact of user substitution is not taken into account.
      Returns:
      currently authenticated user
      Throws:
      RuntimeException - if Authentication is not set to SecurityContext or user information cannot be extracted from current authentication
    • getAuthenticatedUser

      org.springframework.security.core.userdetails.UserDetails getAuthenticatedUser(Map<String,Object> hints)
      Method returns currently authenticated user (the user who actually logged in). The fact of user substitution is not taken into account. See supported hints in the CurrentUserHints.
      Parameters:
      hints - hints with user retrieval instructions
      Returns:
      currently authenticated user
      Throws:
      RuntimeException - if Authentication is not set to SecurityContext or user information cannot be extracted from current authentication
      See Also:
    • getSubstitutedUser

      @Nullable org.springframework.security.core.userdetails.UserDetails getSubstitutedUser()
      Method returns the substituted user or null if user substitution didn't happen.
      Returns:
      substituted user or null if user substitution didn't happen
    • getSubstitutedUser

      @Nullable org.springframework.security.core.userdetails.UserDetails getSubstitutedUser(Map<String,Object> hints)
      Method returns the substituted user or null if user substitution didn't happen. See supported hints in the CurrentUserHints.
      Parameters:
      hints - hints with user retrieval instructions
      Returns:
      substituted user or null if user substitution didn't happen
      See Also:
    • getEffectiveUser

      org.springframework.security.core.userdetails.UserDetails getEffectiveUser()
      Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwise
      Returns:
      substituted user if the substitution happened or authenticated (logged in) user otherwise
    • getEffectiveUser

      org.springframework.security.core.userdetails.UserDetails getEffectiveUser(Map<String,Object> hints)
      Method returns the substituted user if the substitution happened or authenticated (logged in) user otherwise. See supported hints in the CurrentUserHints.
      Parameters:
      hints - hints with user retrieval instructions
      Returns:
      substituted user if the substitution happened or authenticated (logged in) user otherwise
      See Also: