使用authorization_code模式获取token失败

Blade 已结 1 1111
xiyang
xiyang 剑童 2020-05-29 09:47
悬赏:10

一、该问题的重现步骤是什么?

完全按照文档的步骤使用authorization_code模式获取token。


授权码模式(authorization_code)主要针对第三方应用,是最为复杂也最为安全的一种模式,操作步骤如下

1. 访问地址,账号密码为默认的admin:http://localhost:8100/oauth/authorize?

tenant_id=000000&client_id=sword&redirect_uri=http://localhost:8888&code=233333&response_t ype=code

2. 获取跳转后的code值(http://localhost:8888/?code=VhYNLR)之后,调用 http://localhost/blade-auth/oauth/token 传入对应的参数


二、你期待的结果是什么?实际看到的又是什么?

期待结果:

正常获取token


实际结果

1. 由于白名单的原因,/oauth/authorize 这个路径会被拦截,报401。 需要手动白名单放过

2. 白名单放过后,直接在postman中调用接口会报


<oauth>
<error_description>
Full authentication is required to access this resource
</error_description>
<error>unauthorized</error>
</oauth>



三、你正在使用的是什么产品,什么版本?在什么操作系统上?


centos 7


bladex 2.5.0


四、请提供详细的错误堆栈信息,这很重要。

<oauth>
<error_description>
Full authentication is required to access this resource
</error_description>
<error>unauthorized</error>
</oauth>


五、若有更多详细信息,请在下面提供。


综上, 文档写的还是不够全面,希望您能把遗漏的点不上,使之可以正常使用authorization_code模式获取token

1条回答
  •  smallchill
    smallchill (最佳回答者)
    2020-05-29 09:48

    下载最新的2.5.0版本文档再看,写的已经够清楚了

    1 讨论(1)
提交回复