Package org.forgerock.openig.jwt
Class JwtCookieSession
-
- All Implemented Interfaces:
Map<String,Object>,org.forgerock.http.session.Session,DirtyListener
public class JwtCookieSession extends org.forgerock.util.MapDecorator<String,Object> implements org.forgerock.http.session.Session, DirtyListener
Represents an OpenIGSessionthat will be stored as an encrypted JSON Web Token in a Cookie. The generated JWT is encrypted with theJweAlgorithm.RSAES_PKCS1_V1_5algorithm andEncryptionMethod.A128CBC_HS256method.
-
-
Field Summary
Fields Modifier and Type Field Description static StringOPENIG_JWT_SESSIONName of the cookie that will store the JWT session.
-
Constructor Summary
Constructors Constructor Description JwtCookieSession(org.forgerock.http.protocol.Request request, KeyPair pair, String cookieName, String cookieDomain, org.forgerock.util.time.TimeService timeService, org.forgerock.util.time.Duration sessionTimeout, org.forgerock.json.jose.jws.handlers.SigningHandler signingHandler)Builds a new JwtCookieSession that will manage the given Request's session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Set<Map.Entry<String,Object>>entrySet()booleanisEmpty()Set<String>keySet()voidonElementsRemoved()Called when one or more element from the underlying Map are removed.Objectput(String key, Object value)voidputAll(Map<? extends String,?> m)Objectremove(Object key)voidsave(org.forgerock.http.protocol.Response response)Collection<Object>values()-
Methods inherited from class org.forgerock.util.MapDecorator
containsKey, containsValue, equals, get, hashCode, size
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
-
-
-
Field Detail
-
OPENIG_JWT_SESSION
public static final String OPENIG_JWT_SESSION
Name of the cookie that will store the JWT session.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JwtCookieSession
public JwtCookieSession(org.forgerock.http.protocol.Request request, KeyPair pair, String cookieName, String cookieDomain, org.forgerock.util.time.TimeService timeService, org.forgerock.util.time.Duration sessionTimeout, org.forgerock.json.jose.jws.handlers.SigningHandler signingHandler)Builds a new JwtCookieSession that will manage the given Request's session.- Parameters:
request- Request used to access Cookie and Set-Cookie headers.pair- Secret key used to sign the JWT payload.cookieName- Name to be used for the JWT Cookie.cookieDomain- Domain to be used for the JWT Cookie. If null, the cookie will be treated as a host-based cookie.timeService- TimeService to use when dealing with cookie sessions.sessionTimeout- The duration of the cookie session.signingHandler- The JWT signing handler.
-
-
Method Detail
-
onElementsRemoved
public void onElementsRemoved()
Description copied from interface:DirtyListenerCalled when one or more element from the underlying Map are removed.- Specified by:
onElementsRemovedin interfaceDirtyListener
-
clear
public void clear()
-
values
public Collection<Object> values()
-
save
public void save(org.forgerock.http.protocol.Response response) throws IOException- Specified by:
savein interfaceorg.forgerock.http.session.Session- Throws:
IOException
-
-