Giter Site home page Giter Site logo

authorization-server's Introduction

[TOC] 认证服务器

架构

服务调用授权与认证时序如下 网关架构

运行

命令行切换到项目根目录下,执行

mvn spring-boot:run

此时,本地会默认开启8080端口

测试

获取公钥功能

执行命令

curl -i -X GET   "http://client1:secret1@localhost:8080/oauth/token_key"

获取公钥响应结果

HTTP/1.1 200
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 30 May 2019 09:32:52 GMT

{"alg":"SHA256withRSA","value":"-----BEGIN PUBLIC KEY-----\nMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIaDCe9NzAAxU+C3+TFEA0IhuKs+8KgKyr8zIT3TpivBTNhlymOe0U5+L1yK7nWAu5JehXX7snnb79cF2IjJKg8CAwEAAQ==\n-----END PUBLIC KEY-----"}


其中value就是公钥,以后使用公钥即可验证用户提交的token,从token可以得知用户的角色列表

用户获取认证码

/oauth/authorize

网关获取access_token或者第三方获取access_token

/oauth/token

网关校验token

/oauth/check_token

网关确认访问

/oauth/confirm_access

温馨提醒

  • 此项目将会长期维护,增加或改进实用的功能
  • 右上角点击star,给我继续前进的动力,谢谢

authorization-server's People

Contributors

qq275860560 avatar

Watchers

 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.