我试图使用Apigee的GetOAuthv2Info政策,但我认为我遗漏了一些非常简单的东西(对于Apigee / API来说还是新手)...
根据示例配置策略:
<GetOAuthV2Info name="GetTokenAttributes">
<AccessToken>request.queryParam.access_token</AccessToken>
</GetOAuthV2Info>`
如果我尝试通过查询参数传递有效令牌:
http:// {host} / path / to / endpoint?access_token = tUbvXzh97UtRRUuBpGUNpXESJtD1,我收到 404 Not Found 错误代码:
{"fault":"{\"detail\":
{\"errorcode\":\"keymanagement.service.invalid_access_token\"},
\"faultstring\":\"Invalid Access Token\"}"}
这是将访问令牌传递给策略的正确方法吗?
提前致谢!
答案 0 :(得分:0)
尝试:
<GetOAuthV2Info name="GetTokenAttributes">
<AccessToken ref="request.queryparam.access_token"></AccessToken>
</GetOAuthV2Info>
或
<GetOAuthV2Info name="GetTokenAttributes">
<AccessToken>{request.queryparam.access_token}</AccessToken>
</GetOAuthV2Info>
您的原始政策可能使用request.queryParam.access_token
的文字字符串值作为令牌参考。还注意到queryparam
是完整的小写。