[英]how to call a rest api using a bearer token in authorization header in secure way? Sample code c# please
I am thinking to do in inbound policy, is that the right place?我想在入境政策中做,那是正确的地方吗? Also how to set the time for expiry of cache?另外如何设置缓存的到期时间? I am following this but it doesnt say where it has the time for expiry value but just variable I see.我正在关注这一点,但它没有说明它在哪里有到期价值的时间,而只是我看到的变量。 https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Backend%20OAuth2%20Authentication%20With%20Cache.policy.xml https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Backend%20OAuth2%20Authentication%20With%20Cache.policy.xml
How to store the JWT Bearer token I obtain into my APIM.如何将我获得的 JWT 不记名令牌存储到我的 APIM 中。
As you have provided, you can use <set-variable name="accessToken" value=""/>
to store access token.正如您所提供的,您可以使用<set-variable name="accessToken" value=""/>
来存储访问令牌。
how to set the time for expiry of cache如何设置缓存过期时间
The cache-store
policy caches responses according to the specified cache settings. cache-store
策略根据指定的缓存设置缓存响应。 Set response cache duration using maxAge value in Cache-Control header sent by the backend.使用后端发送的 Cache-Control header 中的 maxAge 值设置响应缓存持续时间。
<cache-store duration="seconds" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.