Stateless JWT Authentication via Segmented Cookie Storage

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing JSON Web Token (JWT) authentication methods face limitations when large payloads exceed cookie size limits, leading to incomplete authentication and vulnerability to attacks like XSS and CSRF.

Innovation Solution

Generating JWT components at a server, storing the JWT header and signature in an HTTP-only secure cookie, and the payload as an encrypted access token, allowing clients to reconstruct and verify JWTs during subsequent requests.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the JWT payload includes comprehensive user information (users, roles, groups), then the authentication information becomes complete and robust, but the JWT size exceeds the cookie capacity

Engineering Contradiction:
Improveauthentication completenessVSAvoidJWT size
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The JWT authentication data is segmented into two parts: essential authentication data (header and signature) is placed in the cookie, while the large payload containing detailed user information (users, roles, groups) is stored separately in the HTTP response body. This segmentation allows the cookie to remain within size limits while the complete authentication information is still transmitted to the client.

Inventive Principle:
Principle #1Segmentation

2Ease of operation

If a regular cookie is used to store JWT, then the authentication data is easily accessible, but the system becomes vulnerable to XSS and CSRF attacks

Engineering Contradiction:
Improvedata accessibilityVSAvoidsecurity vulnerability
Core Design Contradiction:
Ease of operationVSObject-affected harmful factors

Solution Approach 1:

The patent introduces an intermediary mechanism by placing the authentication data in an HTTP-only cookie, which acts as a secure mediator between the server and client. This cookie cannot be accessed by JavaScript, preventing XSS attacks, while still being automatically included in HTTP requests for CSRF protection. The authentication flow continues seamlessly through this secure intermediary channel.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If stateful authentication is used to maintain security, then authentication is secure, but the system cannot communicate with multiple different server instances

Engineering Contradiction:
Improveauthentication securityVSAvoidserver instance compatibility
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The authentication token is made self-contained and stateless by including all necessary authentication information (header, payload with user details, and signature) within the JWT structure itself. This allows any server instance to independently verify the token's authenticity through cryptographic validation without needing to query a central authentication service or maintain session state, enabling seamless communication across multiple server instances.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS12177352B2Systems and methods for stateless authentication and authorization using JWT access tokens
Publication Date: 2024.12.24 OPEN TEXT CORP
  • US12177352B2 patent drawing
  • US12177352B2 patent drawing
  • US12177352B2 patent drawing

AI summary

Systems and methods for secure stateless client-server communication. User credentials in a client authorization request are authenticated and used to generate a JSON web token (JWT). The JWT header and signature are encrypted and included in an HTTP-only cookie. The JWT payload is encrypted and sent to the client in a response body along with the HTTP-only cookie. Each subsequent client request includes the cookie and has the encrypted JWT payload in the request header. Upon receiving the request, the server decrypts the encrypted JWT payload from the header and decrypts the encrypted JWT header and signature from the cookie, then reconstructs the JWT from the JWT header, payload and signature. The server validates the JWT and, if valid, processes the request according to authorizations in the JWT payload.