@Component public class JWTTokenHandler extends Object implements org.springframework.beans.factory.InitializingBean
| Constructor and Description |
|---|
JWTTokenHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
String |
createTokenForEPerson(Context context,
javax.servlet.http.HttpServletRequest request,
Date previousLoginDate,
List<Group> groups)
Create a jwt with the EPerson details in it
|
byte[] |
getEncryptionKey() |
long |
getExpirationPeriod() |
void |
invalidateToken(String token,
javax.servlet.http.HttpServletRequest request,
Context context) |
boolean |
isEncryptionEnabled() |
EPerson |
parseEPersonFromToken(String token,
javax.servlet.http.HttpServletRequest request,
Context context)
Retrieve EPerson from a jwt
|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic EPerson parseEPersonFromToken(String token, javax.servlet.http.HttpServletRequest request, Context context) throws com.nimbusds.jose.JOSEException, ParseException, SQLException
token - request - context - com.nimbusds.jose.JOSEExceptionParseExceptionSQLExceptionpublic String createTokenForEPerson(Context context, javax.servlet.http.HttpServletRequest request, Date previousLoginDate, List<Group> groups) throws com.nimbusds.jose.JOSEException, SQLException
context - request - previousLoginDate - groups - com.nimbusds.jose.JOSEExceptionSQLExceptionpublic void invalidateToken(String token, javax.servlet.http.HttpServletRequest request, Context context) throws Exception
Exceptionpublic long getExpirationPeriod()
public boolean isEncryptionEnabled()
public byte[] getEncryptionKey()
Copyright © 2019 DuraSpace. All rights reserved.