Class EPersonRestAuthenticationProvider

java.lang.Object
org.dspace.app.rest.security.EPersonRestAuthenticationProvider
All Implemented Interfaces:
AuthenticationProvider

@Component public class EPersonRestAuthenticationProvider extends Object implements AuthenticationProvider
This class is responsible for authenticating a user via REST.
Author:
Frederic Van Reet (frederic dot vanreet at atmire dot com), Tom Desair (tom dot desair at atmire dot com)
  • Field Details

  • Constructor Details

    • EPersonRestAuthenticationProvider

      public EPersonRestAuthenticationProvider()
  • Method Details

    • postConstruct

      @PostConstruct public void postConstruct()
    • authenticate

      public Authentication authenticate(Authentication authentication) throws AuthenticationException
      Specified by:
      authenticate in interface AuthenticationProvider
      Throws:
      AuthenticationException
    • getGrantedAuthorities

      public List<GrantedAuthority> getGrantedAuthorities(Context context)
      Return list of GrantedAuthority objects for the user currently authenticated in the Context
      Parameters:
      context - current DSpace context
      Returns:
      List of GrantedAuthority. Empty list is returned if no current user exists.
    • supports

      public boolean supports(Class<?> authentication)
      Return whether this provider supports this Authentication type. Only returns true if the Authentication type is a valid DSpaceAuthentication class.
      Specified by:
      supports in interface AuthenticationProvider
      Parameters:
      authentication -
      Returns:
      true if valid DSpaceAuthentication class