Skip to content

Java 8 back-end MVC application based on Spring & Spring boot secured by OAuth2

Notifications You must be signed in to change notification settings

DavidMachacek/springapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

springapp

Test project for Java 8 with Maven secured by OAuth2 with basic UI provided by JSP (front-end is not in the scope of this project).

Technologies:

  • Spring MVC (exposes REST api)
  • Spring Security (OAuth2 tokens)
  • Spring Data (set for H2)
  • Spring Boot (contains its own web container)
  • Spring application events
  • H2 (custom configured in-memory database)
  • Hazelcast (to enable cache)
  • JSP & Thymeleaf (basic UI)
  • MapStruct (mappign TO and entities)
  • Swagger (app exposes its own API blueprint)
  • Docker (contains Dockerfile to deploy in Java-based Docker container)
  • and others..

API blueprint

Exposed at /v2/api-docs

Non-Secured endpoints (currently turned off, fix for auth server is WIP)

  • /
  • /customers
  • /v2/api-docs

Security

Authorization server has in-memory client with following credentials

  • Id: "ClientId"
  • secret: "secret
  • auth grand type: "password"
  • scope: read & write

Application starts up with default user in database

  • username: david
  • password: david

Authorization server grands tokens at /oauth/token

cUrl command

curl -X POST \
  '<host>/oauth/token?grant_type=password&username=david&password=david' \
  -H 'authorization: Basic Q2xpZW50SWQ6c2VjcmV0'

obtained token then send as param, i.e.:

<host>/customers?access_token=cfed3699-d095-4980-baa5-8e33bf7c201d

About

Java 8 back-end MVC application based on Spring & Spring boot secured by OAuth2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published