本人目前正在准备搭建oauth2.0服务,使用的是spring-security-oauth,运行里面的实例sparklr和tonr两个项目,能获取授权码,但获取不了access_token,请高人指导啊,非常非常感谢!

解决方案 »

  1.   

    这个请求,我的code值为cp5XBX,测试返回的json数据为:{"access_token":"96338526-2990-4e61-a32d-c9812c5c3e14","token_type":"bearer","refresh_token":"20f46400-a6a5-4c5a-97d4-464d29c9cea3","expires_in":43199,"scope":"read"}请求URL
    http://localhost:8080/sparklr2/oauth/token?client_id=tonr&client_secret=secret&grant_type=authorization_code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Ftonr2%2Fsparklr%2Fphotos&code=cp5XBX
      

  2.   

    为什么我的结果是{"error":"invalid_grant","error_description":"Invalid authorization code: b2ef0D"};
    请求url:
    http://localhost:8080/sparklr2/oauth/token?client_id=tonr&client_secret=secret&grant_type=authorization_code&redirect_uri=code=b2ef0D&code=b2ef0D
    求指导!!!
      

  3.   

    返回结果是:
    {"error":"invalid_grant","error_description":"Invalid authorization code: b2ef0D"}
    请求地址是:
    http://localhost:8080/sparklr2/oauth/token?client_id=tonr&client_secret=secret&grant_type=authorization_code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Ftonr%2Fsparklr%2Fphotos&code=b2ef0D