Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sts): Fix the problem that the HttpResponse returned by getting STS is null #401

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

zhenlei520
Copy link

No description provided.

@zhenlei520
Copy link
Author

AlibabaCloudCredentialsProvider provider = new AccessKeyCredentialProvider("<your-access-key-id>", "<your-access-key-secret>");
IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou");
DefaultAcsClient client = new DefaultAcsClient(profile, provider);

var request = new AssumeRoleRequest
{
    RoleArn = "<your-role-arn>",
    RoleSessionName = "<your-role-session-name>",
    DurationSeconds = 3600
};
try
{
    var response = client.GetAcsResponse(request);
    Assert.IsNotNull(response.HttpResponse);// Tip: The value of HttpResponse obtained here is null
    Console.WriteLine(System.Text.Encoding.Default.GetString(response.HttpResponse.Content));
}
catch (ServerException e)
{
    Console.WriteLine(e);
}
catch (ClientException e)
{
    Console.WriteLine(e);
}

@CLAassistant
Copy link

CLAassistant commented May 17, 2022

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants