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 OpenIG 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.
    • 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.