我已经在WSO2 AM中发布了一个应用程序接口,现在,当我尝试通过curl传递令牌来测试该应用程序接口时,它显示了一个错误:
curl请求:
curl -X GET "https://192.168.21.120:8243/ms-authorization/1.0.0/authorization/access-type/access-type"
-H "accept: application/json" -H "Authorization: Bearer eyJ4NXQiOiJNell4TW1Ga09HWXdNV0kwWldObU5Er0m9eU..
-iNxXl0D9to5ptemrd42itirPDJiYJJ_FkSMKSfQ6m78X2fr-Tag" -k响应:
{"fault":{"code":900902,"message":"Missing Credentials","description":"Authentication Error. Make sure your API invocation call has a header: testkey is missing"}}为什么header中需要一个"testkey“?
发布于 2021-04-24 05:46:57
我只是启用了CORS配置,重新部署了API,一切都正常了:

发布于 2021-04-19 19:13:25
如果您正在尝试使用Publisher test Console测试API,则需要在您的curl中将生成的访问令牌/测试密钥包含在标题testkey中。
例如:
curl -X GET "https://localhost:8243/napi/1.0/*" -H "accept: */*" -H "testkey: 032456ff-4764-4321-2348-e7ad1ac5t6g0" -khttps://stackoverflow.com/questions/67131174
复制相似问题