Code Monkey home page Code Monkey logo

oauth2-resource's Introduction

接口采用Spring security OAuth2 Resource Server认证

创建数据库:持久层采用Mybatis框架

默认用Mysql数据库,如需用其他数据库请修改配置文件以及数据库驱动
创建数据库SQL:数据库名、数据库用户名、数据库密码需要和application.properties中的一致

CREATE DATABASE IF NOT EXISTS coupon_db DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create user 'coupon'@'localhost' identified by 'password_dev!';
grant all privileges on coupon_db.* to 'coupon'@'localhost';

建表sql在src/main/resources/sql/create-database-table.sql
初始化sql在src/main/resources/sql/init.sql

!!!启动Resource Server之前,须先确认OAUTH2 server运行中,并修改application.properties中issuer-uri指向OAUTH2 server,最后启动Resource Server应用

传递token三种方式

  • header添加Authorization
Authorization:Bearer a.b.c
  • 参数添加access_token
/api/a?access_token=a.b.c
  • cookie添加access_token
access_token=a.b.c

oauth2-resource's People

Contributors

jobmission avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.