Spring Security Tutorial Details Refresh Token Implementation to Complement JWT Authentication
A comprehensive tutorial on Spring Security demonstrates how to extend JWT authentication with refresh tokens to balance security and usability. The guide begins by explaining the limitations of short-lived access tokens, which typically expire within 15 minutes to one hour, and introduces refresh tokens that can last from one week to one month.
The article details the creation of a RefreshToken entity annotated with JPA mappings, including fields for the token string, associated user, expiration instant, and revocation flag. It also provides the corresponding RefreshTokenRepository interface with methods to find tokens and delete all tokens for a given user.
In the service layer, RefreshTokenService implements token creation by removing existing tokens for the user, generating a new UUID-based token, setting an expiration based on a configurable property, and persisting it. The verify method checks for existence, expiration, and revocation status, throwing a custom RefreshTokenException when necessary, while the revoke method marks tokens as revoked.
Security considerations are thoroughly covered, highlighting benefits such as reduced exposure time for access tokens, automatic session renewal, centralized session control, and minimized password transmission. Risks discussed include potential database compromise mitigated by hashing with SHA-256 or HMAC-SHA256, increased database load due to statefulness, implementation complexity involving token rotation, and client-side storage vulnerabilities addressed by using HttpOnly cookies instead of localStorage.
The tutorial updates DTOs to include AuthResponse and RefreshRequest, modifies AuthService to integrate refresh token creation during registration and login, and enhances AuthController with endpoints for refresh and logout. A helper method sets secure, HTTP-only cookies with appropriate path and max-age settings.
Finally, adjustments to SecurityConfig are shown to permit public access to authentication endpoints and profile retrieval while restricting administrative routes, ensuring a complete implementation of refresh token mechanics alongside JWT handling.
Related articles
Aiker World AI Co-Creation Base Officially Lands in Hainan Oriental to Build Long-Term AI Talent and Industry Ecosystem
On August 28, the finals of the Oriental Chuxin FC-OPC Next iCreate AI Native Content Creation Competition were held in Hainan Oriental. Aiker World community, in partnership with Oriental Chuxin, advanced their collaboration by establishing an offline AI co-creation base and connecting online talent with real industrial scenarios. Thirty youth teams presented AI projects focused on Chinese cultural dissemination, Hainan tourism and intangible heritage export, free trade port digital economy, and AI content compliance. The event was attended by senior local officials including Oriental Municipal Party Secretary Li Aihua and Hainan Provincial Tourism and Culture Department Deputy Director Wang Zhongyun. 360 Group representative and Aiker World initiator Hu Xiaona highlighted the shift from AI model development to practical enterprise deployment using tools like Nami Work. The new base aims to link talent, experts, and companies for sustained project delivery beyond single events.
Yandex Builds Secure KVM Access for BareMetal Servers with IPMI Proxy and Network Isolation
Yandex Cloud engineers developed a layered architecture to grant external users safe KVM access to dedicated BareMetal servers while protecting the shared IPMI network. The solution combines IPMI Proxy containers that normalize vendor-specific protocols into VNC, IPMI Router instances running jool for IPv6-to-IPv4 translation, and strict L2/L3 controls using 802.1X, eBPF, and switch ACLs. DHCP is delivered statelessly by deriving IPv4 addresses from MAC addresses to simplify failover with VRRP. Client-side risks from legacy Java and weak hashes are contained by running minimal containers and mounting ISO images from S3 as external volumes. Continuous permission checks every ten seconds ensure long-lived sessions do not become persistent attack paths. The resulting design unifies access across hardware platforms inside the Yandex Cloud console without exposing BMCs to lateral movement.
Russia Approves Dedicated Traffic Regulations for Delivery Robots
Russian authorities have coordinated requirements for the movement of delivery robots, known as rovers, across urban areas. The rules will establish permitted speeds, guidelines for interactions with pedestrians, identification procedures, and operator liability. The draft resolution was prepared by the Ministry of Economic Development together with the Ministry of Transport and the Ministry of Internal Affairs. An experimental legal regime lasting three years will test these measures in 35 regions of Russia. The core principle requires that robots must not obstruct people or create hazards on sidewalks. Specific zones where robots are permitted or prohibited will be defined in the final version of the document.
WebDesktopGL Framework Turns Web Sites into Desktop Apps on Astra Linux via Chromium
WebDesktopGL is an open-source framework that converts web applications into standalone desktop programs using a local Chromium engine. It was developed specifically for Astra Linux to meet strict licensing requirements that prohibit unlicensed software. The solution supports both X11 and Wayland sessions and has been tested on Ubuntu 24.04 KDE, Ubuntu 22.04 KDE, and Astra Linux 1.8. Key technical components include a modified VirtualGL build for GPU acceleration inside Xephyr or Xvfb virtual displays, custom clipboard synchronization via xclip, and a lightweight xdotool_xseticon utility for window management. Two launch scripts are provided: InfoDoc.sh for full isolation on a virtual X server and InfoDoc_light.sh for simpler direct execution suitable for remote deployment. The project aims to serve as a lightweight, license-compliant alternative to Electron for Linux environments.