Skip to content

Conversation

myProjectsRavi
Copy link

Description

Resolves #1195 by adding comprehensive OAuth2 sample implementations for Spring Boot Admin.

Changes Made

New Modules

  • spring-boot-admin-sample-oauth2 - Admin Server with OAuth2 login integration
  • spring-boot-admin-sample-oauth2-client - Monitored application configured as OAuth2 Resource Server

Key Components

Admin Server (OAuth2 Client):

  • OAuth2SecurityConfig - OAuth2 login configuration with oauth2Login()
  • OAuth2RestTemplateConfig - RestTemplate with OAuth2 client credentials support
  • SpringBootAdminOAuth2Application - Main application with @EnableAdminServer

Client App (OAuth2 Resource Server):

  • OAuth2ResourceServerConfig - JWT-based resource server protecting actuator endpoints
  • OAuth2ClientApplication - Sample monitored application with BufferingApplicationStartup

Configuration Examples

  • Complete OAuth2 client registration setup (client-credentials flow)
  • Resource server JWT validation configuration
  • Environment variable support via application-oauth2.yml
  • Actuator endpoints exposure for monitoring

Module Integration

  • Updated parent samples POM to include both new modules
  • Follows existing project structure and naming conventions
  • Compatible with current Spring Boot 3.x and Spring Security patterns

Testing

  • ✅ Clean build passes (mvn clean install)
  • ✅ Both applications start successfully
  • ✅ OAuth2 client can obtain tokens using client-credentials flow
  • ✅ Resource server validates JWT tokens for actuator endpoints
  • ✅ Admin server can monitor OAuth2-protected client applications

Documentation

Includes example configurations for:

  • Auth0 OAuth2 provider setup
  • Client credentials flow
  • JWT resource server validation
  • Environment-based configuration

Closes #1195

@myProjectsRavi myProjectsRavi requested a review from a team as a code owner August 24, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide Sample Project using OAuth2
1 participant