欢迎使用CSDN-markdown编辑器

来源:互联网 发布:神知结局形象 编辑:程序博客网 时间:2024/06/03 22:57

spring-security-oauth2:

  • 获取code:
    172.31.42.124:8080/uaa/oauth/authorize?response_type=code&client_id=ace&redirect_uri=http://www.baidu.com

  • 获取access_token:
    curl -X POST -H “Cant-Type: application/x-www-form-urlencoded” -d ‘grant_type=authorization_code&code=7nV52G&redirect_uri=http://www.baidu.com’ “http://ace:secret@172.31.42.124:8080/uaa/oauth/token”

  • 访问受保护接口
    TOKEN=4e63e92e-2c9b-462b-9f47-ee37f72dfed7
    curl -H “Authorization: Bearer $TOKEN” 172.31.42.124:8080/uaa/hello