无法使用authorization_code模式获取token

Blade 已结 2 1784
xiyang
xiyang 2020-05-25 14:58

按照文档所述,目前无法使用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 传入对应的参数



期望的结果:

能正常按照authorization_code获取到token


实际结果:

404

2条回答
  •  xiyang
    xiyang (楼主)
    2020-05-28 10:14

    完全按照文档上的步骤,是无法使用authorization_code模式获取token。

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

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




    Full authentication is required to access this resource

    unauthorized


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

代码语言
提交回复