AssumeRoleWithSAML() private méthode

private AssumeRoleWithSAML ( AssumeRoleWithSAMLRequest request ) : AssumeRoleWithSAMLResponse
request Amazon.SecurityToken.Model.AssumeRoleWithSAMLRequest
Résultat Amazon.SecurityToken.Model.AssumeRoleWithSAMLResponse
        public SessionAWSCredentials GetSamlRoleCredentails(string samlAssertion, string awsRole)
        {
            string[] role = awsRole.Split(',');

            AssumeRoleWithSAMLRequest samlRequest = new AssumeRoleWithSAMLRequest();
            samlRequest.SAMLAssertion = samlAssertion;
            samlRequest.RoleArn = role[1];
            samlRequest.PrincipalArn = role[0];
            samlRequest.DurationSeconds = 3600;

            AmazonSecurityTokenServiceClient sts;
            AssumeRoleWithSAMLResponse samlResponse;
            try {
                sts = new AmazonSecurityTokenServiceClient();
                samlResponse = sts.AssumeRoleWithSAML(samlRequest);
            }
            catch
            {
                sts = new AmazonSecurityTokenServiceClient("a", "b", "c");
                samlResponse = sts.AssumeRoleWithSAML(samlRequest);
            }

            SessionAWSCredentials sessionCredentials = new SessionAWSCredentials(
                samlResponse.Credentials.AccessKeyId,
                samlResponse.Credentials.SecretAccessKey,
                samlResponse.Credentials.SessionToken);

            return sessionCredentials;
        }
 private Credentials GetServiceCredentials()
 {
     if (_assumeRequest != null)
     {
         return(_stsClient.AssumeRole(_assumeRequest).Credentials);
     }
     return(_stsClient.AssumeRoleWithSAML(_assumeSamlRequest).Credentials);
 }