Closed guyangxizhao closed 1 month ago
1.获取code http://127.0.0.1:8081/oauth2/authorize?response_type=code&client_id=admin&redirect_uri=https://www.baidu.com&scope=openid&state=normal 2.获取token 使用form提交参数 url:http://127.0.0.1:8081/oauth2/token grant_type:authorization_code redirect_uri:https://www.baidu.com code: <通过上一步获取的code> client_assertion_type:urn:ietf:params:oauth:client-assertion-type:client_secret_basic <因为使用client_secret_basic作为client认证类型,是标准的basic-auth,所有需要在header添加 Authorization> <Authorization:Basic base64(client-id:client-secret) 空格不可少>
response: { "error_description": "OAuth 2.0 Parameter: grant_type", "error": "unsupported_grant_type", "error_uri": "https://datatracker.ietf.org/doc/html/rfc6749#section-5.2" }
版本 问题依旧