您当前的位置: 首页 >  I.T10001 数据库

springcloud+oauth2实现开放平台-无数据库(1)

I.T10001 发布时间:2020-01-11 19:20:40 ,浏览量:3

项目结构:

服务端:oauth-server

客户端(第三方客户接入测试代码参考此项目):oauth-client

=====================服务端代码===============================

1、pom.xml依赖

2、属性配置

3、授权认证代码

4、拦截器

5、启动类

6、访问测试(效果参考springcloud搭建Oauth2.0开放平台-效果(2)):http://localhost:8115/oauth/authorize?response_type=code&client_id=client_1&redirect_uri=http://www.baidu.com

=====================客户端代码===============================

1、pom.xml依赖参考服务端

2、属性配置

3、客户端配置中心-拦截层

3、测试类

4、启动类

5、测试返回结果

localhost:8116/api/order/getOrderInfo

参数必须放在头部认证:

格式:bearer +空格+token

Authorization=bearer 2eee1e81-d14c-4d24-91f6-42d4d3c4a348

关注
打赏
1688896170
查看更多评论

I.T10001

暂无认证

  • 3浏览

    0关注

    154博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.4772s