Tagged articles
2 articles
Page 1 of 1
Code Ape Tech Column
Code Ape Tech Column
Jun 20, 2022 · Backend Development

Customizing the Token Response Format in Spring Security OAuth2

This article explains how to override Spring Security OAuth2's default /oauth/token endpoint to return a unified response structure by redefining the TokenEndpoint and optionally the CheckTokenEndpoint, providing complete Java code examples and implementation details.

Backend DevelopmentJavaOAuth2
0 likes · 6 min read
Customizing the Token Response Format in Spring Security OAuth2
Java Architecture Diary
Java Architecture Diary
Apr 20, 2020 · Backend Development

How to Customize OAuth2 Tokens with Business Data in Spring Security

This article explains how to extend the default OAuth2 token response by embedding business-related fields such as tenant_id, user_id, and username, and walks through the underlying Spring Security code—including the password grant flow, token creation, and enhancement process—illustrated with code snippets and diagrams.

AuthenticationOAuth2Token Customization
0 likes · 5 min read
How to Customize OAuth2 Tokens with Business Data in Spring Security