zoukankan      html  css  js  c++  java
  • spring-oauth-server实践:OAuth2.0 通过header 传递 access_token 验证

    一、解析查找 access_token

    1、OAuth2AuthenticationProcessingFilter.tokenExtractor

    2、发现来源可以有两处:请求的头或者请求的参数

    二、总结

    1、如果使用头信息传递,指定方式::Authorization=bearer0206e73d-3e2b-4886-90ff-1e7edc6b34f5

    如:

    http://localhost:9000/api-gateway-engine/API/LsqGrp1/LsqVer1/LsqApi1

    报文格式:

    POST /api-gateway-engine/API/LsqGrp1/LsqVer1/LsqApi1 HTTP/1.1
    Host: localhost:9000
    Authorization: bearer0206e73d-3e2b-4886-90ff-1e7edc6b34f5
    Cache-Control: no-cache
    Postman-Token: 2a255144-81ad-7712-7354-e64076e525c2
    Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

    ------WebKitFormBoundary7MA4YWxkTrZu0gW-- 

    2、如果使用请求参数传递,指定方式::access_token=0206e73d-3e2b-4886-90ff-1e7edc6b34f5

    如:

    http://localhost:9000/api-gateway-engine/API/LsqGrp1/LsqVer1/LsqApi1?access_token=0206e73d-3e2b-4886-90ff-1e7edc6b34f5

    三、举例

    1、DevApp侧

    2、api-gateway-engine

  • 相关阅读:
    支持向量机(一)
    决策树(四)
    决策树(三)
    决策树(二)
    决策树(一)
    朴素贝叶斯(一)
    k近邻法(二)
    k近邻法(一)
    感知机
    mercurial 入门
  • 原文地址:https://www.cnblogs.com/lexiaofei/p/7203790.html
Copyright © 2011-2022 走看看