Skip to content

Commit

Permalink
Add useragent for OIDC assume role
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Aug 20, 2024
1 parent f9a757f commit ce982be
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.aliyuncs.http.HttpRequest;
import com.aliyuncs.http.HttpResponse;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.http.UserAgentConfig;
import com.aliyuncs.http.clients.CompatibleUrlConnClient;
import com.aliyuncs.utils.AuthUtils;
import com.aliyuncs.utils.ParameterHelper;
Expand Down Expand Up @@ -148,6 +149,7 @@ private String invokeAssumeRoleWithOIDC() throws ClientException {
httpRequest.setHttpContentType(FormatType.FORM);
httpRequest.setSysConnectTimeout(1000);
httpRequest.setSysReadTimeout(3000);
httpRequest.putHeaderParameter("UserAgent", UserAgentConfig.resolve(null, null));
String oidcToken = AuthUtils.readFile(oidcTokenFilePath);
if (oidcToken == null) {
throw new ClientException("Read OIDC token failed");
Expand Down

0 comments on commit ce982be

Please sign in to comment.