Interface RestAuthenticationService

  • All Known Implementing Classes:
    JWTTokenRestAuthenticationServiceImpl

    @Service
    public interface RestAuthenticationService
    Interface for a service that can provide authentication for the REST API
    Author:
    Frederic Van Reet (frederic dot vanreet at atmire dot com), Tom Desair (tom dot desair at atmire dot com)
    • Method Detail

      • addAuthenticationDataForUser

        void addAuthenticationDataForUser​(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          DSpaceAuthentication authentication,
                                          boolean addCookie)
                                   throws IOException
        Throws:
        IOException
      • getShortLivedAuthenticationToken

        AuthenticationToken getShortLivedAuthenticationToken​(Context context,
                                                             javax.servlet.http.HttpServletRequest request)
        Retrieve a short lived authentication token, this can be used (among other things) for file downloads
        Parameters:
        context - the DSpace context
        request - The current client request
        Returns:
        An AuthenticationToken that contains a string with the token
      • getAuthenticatedEPerson

        EPerson getAuthenticatedEPerson​(javax.servlet.http.HttpServletRequest request,
                                        Context context)
      • hasAuthenticationData

        boolean hasAuthenticationData​(javax.servlet.http.HttpServletRequest request)
      • invalidateAuthenticationData

        void invalidateAuthenticationData​(javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response,
                                          Context context)
                                   throws Exception
        Throws:
        Exception
      • getWwwAuthenticateHeaderValue

        String getWwwAuthenticateHeaderValue​(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
        Return the value that should be passed in the WWWW-Authenticate header for 4xx responses to the client
        Parameters:
        request - The current client request
        response - The response being build for the client
        Returns:
        A string value that should be set in the WWWW-Authenticate header
      • invalidateAuthenticationCookie

        void invalidateAuthenticationCookie​(javax.servlet.http.HttpServletResponse res)