Two-Token Session Management for Secure Multi-Device Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing session management systems in the Internet of Things era face challenges in maintaining user sessions securely and efficiently across multiple devices and services, leading to undesirable user experiences due to frequent re-authentication requirements and security risks associated with authentication cookies.
Innovation Solution
A two-token model is implemented, where a short-lived access token and a long-lived grant token are used to manage user sessions, with the grant token allowing seamless session continuation across devices and services, and the access token being periodically refreshed to mitigate security risks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Duration of action of stationary object
If authentication cookies are used to maintain stateful sessions, then user session continuity is improved, but security risk increases due to cookie theft and impersonation
Solution Approach 1:
The authentication system is segmented into two separate tokens: a long-lived grant token stored securely in the database and a short-lived access token transmitted in HTTP requests. This segmentation allows the session to maintain continuity through the persistent grant token while minimizing security risks by limiting the lifespan and scope of the transmitted access token.
Solution Approach 2:
The access token acts as an intermediary between the grant token and the HTTP request system. Instead of transmitting the grant token directly in requests, the access token serves as a temporary proxy that can be safely invalidated and regenerated, thereby protecting the underlying grant token from exposure while maintaining session continuity.
2Object-affected harmful factors
If cookie lifetime is shortened to mitigate security risks, then security is improved, but user experience deteriorates due to frequent re-authentication
Solution Approach 1:
The token system segments authentication into two layers with different lifetimes: the grant token maintains long-term security validity in the database, while the access token provides short-term request authentication. This allows the system to maintain tight security on the critical grant token while providing user-friendly long-term session persistence through the reusable grant token.
Solution Approach 2:
The grant token is preliminarily established through secure database authentication and stored for long-term use. This preliminary authentication action eliminates the need for frequent re-authentication, as the grant token can be repeatedly used to generate new access tokens without requiring user re-login, thereby improving user experience while maintaining security.
3Device complexity
If authentication cookies are used, then session identification is simplified, but adaptability across multiple devices deteriorates
Solution Approach 1:
The grant token stored in the database serves as a universal authentication credential that can be used across multiple devices and user agents. Instead of device-specific cookies, the same grant token can be retrieved and used on any device, enabling seamless multi-device support while maintaining simplified session management through the token-based approach.
Data Source
AI summary
A system maintains a web session across multiple web resources and/or devices using a two-token model. A user agent transmits an authentication request to a login endpoint. The user agent have access to a grant token, and it will receive an access token in response to the authentication request. The grant token is relatively long-lived and the first access token is relatively short-lived. The user agent will use the access token to access the first web resource and establish a web session. When the access token expires or is about to expire, the user agent will transmit a re-authentication request with the grant token to a re-authentication endpoint. The user agent will then receive a second access token from the re-authentication endpoint. The user agent will then use the second access token to access the web resource and maintain the web session.


