无法在 wso2 API 管理器存储中创建访问令牌授予类型以测试 API [英] Unable to create Access token grant type in wso2 API manager store to test API

查看:19
本文介绍了无法在 wso2 API 管理器存储中创建访问令牌授予类型以测试 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注这个 link

阅读本段API 现已在 API Store 中可用,并且......"

Read this paragraph "The API is now available in the API Store and ...."

我正在处理本段中的窗口,他们说创建访问令牌curl"命令.但我做不到.

Am working on window in this paragraph they are saying create Access token "curl" command. But i am unable to do that.

也在订阅 API 后创建访问令牌在我的订阅"选项卡中,有两个选项可以创建访问令牌生产"和沙盒",但使用该令牌 API 调用会出现错误.

Also am creating access token after subscribe API In "MY Subscription" tab there are two option to create Access token "Production" and "Sandbox" but by using that token API calling giving error.

"900910访问令牌不允许您访问请求的资源API 访问失败:/accessPolicy/v1.0.0,版本:v1.0.0,密钥:e2dc44322fe78bb7bdb6d83519ff863e"

" 900910 The access token does not allow you to access the requested resource Access failure for API: /accessPolicy/v1.0.0, version: v1.0.0 with key: e2dc44322fe78bb7bdb6d83519ff863e "

推荐答案

该错误表示您生成的令牌不具有相关范围.这可能是因为您尝试生成此令牌的用户没有相关角色来生成具有此范围的此令牌,或者您的令牌请求没有正确定义范围参数.

The error means the token you generated does not have the related scope. This could happen because either the user you try to generate this token does not have relevant roles to generate this token with this scope or your token request does not have the scope parameter defined correctly.

当您向令牌端点发出请求时,响应负载包含作用域(如果没有作用域或作用域对此用户无效,则返回作用域为默认").因此您可以检查请求的令牌是否具有正确的范围.

When you do a request to the token endpoint, the response payload contains the scope (if no scope or scope is not valid for this user, it returns scope as 'default'). So you could check whether the requested token has the correct scope.

最后,我认为 curl 在 windows 上的工作方式与在 linux 中的工作方式不同(与单引号和双引号有关).因此,您要么必须更改 curl 命令,要么使用 rest 客户端(例如 POSTMAN)

Finally, I think the curl is not working on windows the same way as it works in linux (something to do with single and double quotes ). So either you will have to change the curl command or use a rest client (such as POSTMAN)

这篇关于无法在 wso2 API 管理器存储中创建访问令牌授予类型以测试 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆