如果没有刷新令牌,Mule http-request oauth2 是否每次都请求令牌?

Does Mule http-request oauth2 requests for token everytime if there is no refresh token?

我有这个:

<http:request-config name="ApiRest" protocol="HTTPS" doc:name="HTTP Request Configuration" basePath="rest" host="${api.endpointUrl}" port="443"> <oauth2:client-credentials-grant-type clientId="${api.client_id}" clientSecret="${api.client_secret}"> <oauth2:token-request tokenUrl="${api.endpointUrl}/oauth/token" /> </oauth2:client-credentials-grant-type> </http:request-config>

该服务不提供刷新令牌。 access_token 会保存在某处并重新使用还是每次都会请求令牌?

它使用内存中的对象存储(https://developer.mulesoft.com/docs/display/current/Mule+Object+Stores) for reusing the token. This is configurable and you can provide your own object store if you need persistence etc. by using a token-manager Here is an example: https://github.com/mulesoft/mule/blob/292d0938eaac5f63219e7c20f564a9bd66c2bed6/modules/oauth/src/test/resources/client-credentials/client-credentials-full-config-tls-nested.xml