Skip to content

Pivopil/spring-boot-oauth2-rest-service-password-encoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot OAuth2 REST Server with Password Encoding

Simple Spring Boot OAuth2 REST server with password encoding. The REST server is based on the Spring REST Service OAuth app and Building a RESTful Web Service getting started guide.

Release Notes

v1.0

  • Task #1.0.1 (DONE) BE core functionality

v1.1 (current)

  • Task #1.1.1 (DONE) create security service

  • Task #1.1.2 (DONE) use JPA for clients

  • Task #1.1.3 (DONE) create sql script for initial db data creation

  • Task #1.1.4 (DONE, will be improved in v1.2) initial integration tests for content controller and user controller

  • Task #1.1.5 (DONE) store tokens in DB

  • Task #1.1.6 (DONE) create user service and update user controller

  • Task #1.1.7 (DONE) create client service and client controller

  • Task #1.1.8 (DONE) create company (role) service and company (role) controller

  • Task #1.1.9 (DONE) ExceptionAdapter and Exception controller

  • Task #1.1.10 (DONE) add company functionality to role service and role controller

  • Task #1.1.11 (DONE) add Oval validation for entities

v1.2 (in progress)

  • Task #1.2.1 (1%) Update loggers

  • Task #1.2.2 (1%) Create SQL script for DB and update Hibernate functionality

  • Task #1.2.3 Improve integration tests for FE needs

  • Task #1.2.4 Create basic spec

  • Task #1.2.5 (DONE) Move React module to external repo

  • Task #1.2.6 (DONE) Move Angular 2 module to external repo

  • Task #1.2.7 (10%) Update exception functionality

  • Task #1.2.8 (1%) Refactoring

v2.0 (Java 9, Spring 5, Spring Boot 2.0)

BUG

  • (BUG) Spring Session does not persist to Redis

Build and Run in Tomcat

git clone https://github.com/Pivopil/spring-boot-oauth2-rest-service-password-encoding.git
cd spring-boot-oauth2-rest-service-password-encoding
mvn clean install

First update properties to you own prod db (create empty DB with this name manually): ./rest/src/main/resources/application.properties

spring.datasource.url=jdbc:postgresql://localhost:5432/oauth2rx
spring.datasource.username=postgres
spring.datasource.password=1

Then update properties to you own test db (create empty DB with this name manually): ./rest/src/test/resources/test.properties

spring.datasource.url=jdbc:postgresql://localhost:5432/testoauth2rx
spring.datasource.username=postgres
spring.datasource.password=1

Then execute this sql script from for both prod and test databases manually:

/rest/src/main/resources/sql/acl-token-tables.sql

Then:

mvn clean install

And put ./rest/target/rest-1.0.0.war to Tomcat

PostgreSQL Database commands

Create Dump

pg_dump -U postgres -h localhost -d oauth2rx -f oauth2rx_pg_db.sql

Restore from Dump

psql -U postgres -h localhost -d oauth2rx -f oauth2rx_pg_db.sql

Drop Database

DROP DATABASE IF EXISTS oauth2rx;

Create Database

CREATE DATABASE IF NOT EXISTS oauth2rx;

About

Spring OAuth2 simple REST Service with password encoding

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages