Class JWTTokenRestAuthenticationServiceImpl

  • All Implemented Interfaces:
    RestAuthenticationService, org.springframework.beans.factory.InitializingBean

    @Component
    public class JWTTokenRestAuthenticationServiceImpl
    extends Object
    implements RestAuthenticationService, org.springframework.beans.factory.InitializingBean
    Rest Authentication implementation for JSON Web Tokens
    Author:
    Frederic Van Reet (frederic dot vanreet at atmire dot com), Tom Desair (tom dot desair at atmire dot com), Giuseppe Digilio (giuseppe dot digilio at 4science dot it)
    • Constructor Detail

      • JWTTokenRestAuthenticationServiceImpl

        public JWTTokenRestAuthenticationServiceImpl()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • getShortLivedAuthenticationToken

        public AuthenticationToken getShortLivedAuthenticationToken​(org.dspace.core.Context context,
                                                                    javax.servlet.http.HttpServletRequest request)
        Create a short-lived token for bitstream downloads among other things
        Specified by:
        getShortLivedAuthenticationToken in interface RestAuthenticationService
        Parameters:
        context - The context for which to create the token
        request - The request for which to create the token
        Returns:
        The token with a short lifespan
      • getAuthenticatedEPerson

        public org.dspace.eperson.EPerson getAuthenticatedEPerson​(javax.servlet.http.HttpServletRequest request,
                                                                  org.dspace.core.Context context)
        Specified by:
        getAuthenticatedEPerson in interface RestAuthenticationService
      • getWwwAuthenticateHeaderValue

        public String getWwwAuthenticateHeaderValue​(javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
        Description copied from interface: RestAuthenticationService
        Return the value that should be passed in the WWWW-Authenticate header for 4xx responses to the client
        Specified by:
        getWwwAuthenticateHeaderValue in interface RestAuthenticationService
        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