Skip to content

Spring Security 6.4.4 REST client microservice OAuth2 Authorization Server over HTTPS with federated tokens and PostgreSQL

Notifications You must be signed in to change notification settings

BurshteynAnton/OAuth2SecureService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OAuth2 Authorization Server ๐Ÿ›ก๏ธ๐Ÿ”

Architecture Diagram
This project implements a secure OAuth2 Authorization Server using HTTPS, Spring Boot 3.4, Spring Security 6.4, and Spring Authorization Server 1.4.2.
It supports RestClient, federated login, JWT tokens, token storage, and OIDC discovery โ€” following modern Spring Security best practices


๐Ÿ’ก Tech Stack

  • Java โ€“ business logic and user management
  • Spring Boot 3.4, Spring Security 6.4
  • Spring Authorization Server 1.4.2
  • Security โ€“ OAuth2, OIDC, JWT
  • PostgreSQL โ€“ persistent token and user storage

Project Showcase


Key Engineering Challenges

  • JWT-based authentication with access tokens
  • Federated login (Google) via Spring Authorization Server
  • Token customization using claims mapper
  • HTTPS-only flow with self-signed certificate
  • Full support for OIDC discovery and token endpoints
  • RestClient integration for secure inter-service communication
  • Clean setup with Spring Security 6.4.4 โ€” no deprecated APIs, everything works out of the box

Endpoints Overview

Port Endpoint Description
9000 /oauth2/authorize OAuth2 authorization endpoint
9000 /oauth2/token Token issuing endpoint
9000 /.well-known/openid-configuration OIDC discovery endpoint
8080 /public Public data from resource server
8080 /secure Protected data (requires token)
8080 /token Shows current token metadata

Access Services

  • Client Application: https://localhost:8080
  • Resource Server: https://localhost:8081
  • Authorization Server: https://localhost:9000

โš ๏ธ Technical Notes

  • This microservice uses a self-signed HTTPS certificate to secure the full OAuth2 authorization flow (as required by Spring Security).
  • In a production setup, I would use Nginx as a reverse proxy and obtain Let's Encrypt or commercial certificates, depending on business needs.

๐Ÿค Thanks for Your Interest!

I'm always open to feedback, collaboration, or professional connections.
Feel free to reach out!

About

Spring Security 6.4.4 REST client microservice OAuth2 Authorization Server over HTTPS with federated tokens and PostgreSQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published