Class OidcCookieHandler


  • public class OidcCookieHandler
    extends Object
    Handler of cookies used in OIDC.
    • Method Detail

      • createCookie

        public Single<SetCookie.Builder> createCookie​(String value)
        SetCookie builder to set a new cookie, returns a future, as the value may need to be encrypted using a remote service.
        Parameters:
        value - value of the cookie
        Returns:
        a new builder to configure set cookie configured from OIDC Config
      • cookieName

        public String cookieName()
        Cookie name.
        Returns:
        name of the cookie to use
      • removeCookie

        public SetCookie.Builder removeCookie()
        SetCookie builder to remove an existing cookie (such as during logout).
        Returns:
        a new builder to configure set cookie configured from OIDC Config with expiration set to epoch begin and empty value
      • findCookie

        public Optional<Single<String>> findCookie​(Map<String,​List<String>> headers)
        Locate cookie in a map of headers and return its value. If the cookie is encrypted, decrypts the cookie value.
        Parameters:
        headers - headers to process
        Returns:
        cookie value, or empty if the cookie could not be found
      • decrypt

        public Single<String> decrypt​(String cipherText)
        Decrypt a cipher text into clear text (if encryption is enabled).
        Parameters:
        cipherText - cipher text to decrypt
        Returns:
        secret