Deep Integrate Spring Security & OAuth2

base on Spring-Boot

spring-oauth-server is based on spring-security-oauth2, but we do more useful extension as follow

  1. Split Spring MVC configuration and OAuth configuration

  2. Save Spring Security User data to database

  3. Save ClientDetails to database, and manage it

  4. Extend ClientDetails fields, add trusted field for check the client is trust or not

  5. Cancel unnecessary configuration

  6. Different resources config different roles

  7. access_token, code save to database(replace save to memory)

  8. Add Restful OAuth API, see OAuthRestController

Dependency Framework, version

  • JDK (1.8.0_40)
  • Servlet API (3.1.0)
  • Spring Boot(2.0.1.RELEASE)
  • spring-security-oauth2 (2.3.0.RELEASE)

How to use

  1. Download or clone the project source code to local computer, make sure the computer install JAVA development environment(JDK,Maven,Tomcat,IDE...)

  2. Create MySql(5.0+) Database: oauth2_boot, run SQL script files(position: /others/database), run script order: initial_db.ddl -> oauth.ddl -> initial_data.ddl.

  3. Config application.properties (position: src/main/resources), update database connection information(username, password).

  4. Use Maven import local project to IDE(for example: Intellij IDEA), Add Servlet-Container-Server(Tomcat), startup the server(make sure set project contextPath = 'spring-oauth-server').
    Besides, use maven command mvn package compile the project(generate 'spring-oauth-server.war'), copy the war to Tomcat(make sure add 'application.properties' to classpath) and startup.

  5. Visit oauth_test.txt (position: others) and testing step by step(Browser default URL: http://localhost:8080/spring-oauth-server).

Database table,column explain

db_table_description.html(position: /others) is explain the SQL file oauth.ddl all tables, columns, tell how to use and where use.
Online visit address http://andaily.com/spring-oauth-server/db_table_description.html(Chinese).


Project Blog address: http://andaily.com/blog/?cat=19(Chinese)

More my open-source projects: http://andaily.com/my_projects.html

More help please contact: [email protected]

项目中文GIT库地址: https://gitee.com/shengzhao/spring-oauth-server

Spring Security OAuth2 开发指南[中文] https://www.oschina.net/translate/spring-security-oauth-docs-oauth2

Expect your joining...