public class JwtSessionFactory extends GenericHeapObject implements SessionFactory
JwtCookieSession
.
{ "name": "JwtSession", "type": "JwtSession", "config": { "keystore": "Ref To A KeyStore", "alias": "PrivateKey Alias", "password": "KeyStore/Key Password", "cookieName": "OpenIG" } }All the session configuration is optional: if you omit everything, the appropriate keys will be generated and the cookie name used will be
JwtCookieSession.OPENIG_JWT_SESSION
.
The keystore attribute is an optional attribute that references a KeyStore
heap object. It will
be used to obtain the required encryption keys. If omitted, the alias and password
attributes will also be ignored, and a temporary key pair will be generated.
The alias string attribute specifies the name of the private key to obtain from the KeyStore. It is only required when a keystore is specified.
The password static expression attribute specifies the password to use when reading the private key from the KeyStore. It is only required when a keystore is specified.
The cookieName optional string attribute specifies the name of the cookie used to store the encrypted JWT.
If not set, JwtCookieSession.OPENIG_JWT_SESSION
is used.
Modifier and Type | Class and Description |
---|---|
static class |
JwtSessionFactory.Heaplet
Creates and initializes a jwt-session in a heap environment.
|
logger, storage
SESSION_FACTORY_HEAP_KEY
Constructor and Description |
---|
JwtSessionFactory(KeyPair keyPair,
String cookieName)
Builds a new JwtSessionFactory using the given KeyPair for session encryption, storing the opaque result in a
cookie with the given name.
|
public JwtSessionFactory(KeyPair keyPair, String cookieName)
keyPair
- Private and public keys used for ciphering/decipheringcookieName
- name of the cookiepublic Session build(Exchange exchange)
SessionFactory
build
in interface SessionFactory
exchange
- Exchange to create a session for.Copyright © 2014 ForgeRock AS. All rights reserved.