mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
Authorization for file downloads: Small comment changes
This commit is contained in:
@@ -29,6 +29,12 @@ public interface RestAuthenticationService {
|
|||||||
void addAuthenticationDataForUser(HttpServletRequest request, HttpServletResponse response,
|
void addAuthenticationDataForUser(HttpServletRequest request, HttpServletResponse response,
|
||||||
DSpaceAuthentication authentication, boolean addCookie) throws IOException;
|
DSpaceAuthentication authentication, boolean addCookie) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a short lived authentication token, this can be used (among other things) for file downloads
|
||||||
|
* @param context the DSpace context
|
||||||
|
* @param request The current client request
|
||||||
|
* @return An AuthenticationToken that contains a string with the token
|
||||||
|
*/
|
||||||
AuthenticationToken getShortLivedAuthenticationToken(Context context, HttpServletRequest request);
|
AuthenticationToken getShortLivedAuthenticationToken(Context context, HttpServletRequest request);
|
||||||
|
|
||||||
EPerson getAuthenticatedEPerson(HttpServletRequest request, Context context);
|
EPerson getAuthenticatedEPerson(HttpServletRequest request, Context context);
|
||||||
|
@@ -50,7 +50,7 @@ public class ShortLivedJWTTokenHandler extends JWTTokenHandler {
|
|||||||
Date expirationTime = jwtClaimsSet.getExpirationTime();
|
Date expirationTime = jwtClaimsSet.getExpirationTime();
|
||||||
return signedJWT.verify(verifier)
|
return signedJWT.verify(verifier)
|
||||||
&& expirationTime != null
|
&& expirationTime != null
|
||||||
//Ensure expiration timestamp is after the current time, with a minute of acceptable clock skew.
|
//Ensure expiration timestamp is after the current time
|
||||||
&& DateUtils.isAfter(expirationTime, new Date(), 0);
|
&& DateUtils.isAfter(expirationTime, new Date(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user