public class JwtCookieSession extends org.forgerock.util.MapDecorator<String,Object> implements Session, DirtyListener
Session
that will be stored as an encrypted JSON Web Token in a Cookie.
The generated JWT is encrypted with the JweAlgorithm.RSAES_PKCS1_V1_5
algorithm and EncryptionMethod.A128CBC_HS256
method.Modifier and Type | Field and Description |
---|---|
static String |
OPENIG_JWT_SESSION
Name of the cookie that will store the JWT session.
|
Constructor and Description |
---|
JwtCookieSession(Exchange exchange,
KeyPair pair,
String cookieName,
Logger logger)
Builds a new JwtCookieSession that will manage the given Exchange's session.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
close() |
Set<Map.Entry<String,Object>> |
entrySet() |
Set<String> |
keySet() |
void |
onElementsRemoved()
Called when one or more element from the underlying Map are removed.
|
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,?> m) |
Object |
remove(Object key) |
Collection<Object> |
values() |
containsKey, containsValue, equals, get, hashCode, isEmpty, size
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
containsKey, containsValue, equals, get, hashCode, isEmpty, size
public static final String OPENIG_JWT_SESSION
public JwtCookieSession(Exchange exchange, KeyPair pair, String cookieName, Logger logger)
exchange
- Exchange 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.logger
- Loggerpublic void onElementsRemoved()
DirtyListener
onElementsRemoved
in interface DirtyListener
public void clear()
public Collection<Object> values()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2014 ForgeRock AS. All rights reserved.