Ejemplo n.º 1
0
        public async Task CredentialsFromSsoAccessTokenAsync()
        {
            var credentials = await CoreAmazonSSO.CredentialsFromSsoAccessTokenAsync(
                _testFixture.SsoClient.Object,
                _testFixture.GetRoleCredentialsRequest.AccountId,
                _testFixture.GetRoleCredentialsRequest.RoleName,
                _testFixture.GetRoleCredentialsRequest.AccessToken,
                null);

            Assert.IsNotNull(credentials);

            var immutableCredentials = credentials as SSOImmutableCredentials;

            Assert.IsNotNull(immutableCredentials);
            Assert.AreEqual(_testFixture.GetRoleCredentialsResponse.RoleCredentials.AccessKeyId, immutableCredentials.AccessKey);
            Assert.AreEqual(_testFixture.GetRoleCredentialsResponse.RoleCredentials.SecretAccessKey, immutableCredentials.SecretKey);
            Assert.AreEqual(_testFixture.GetRoleCredentialsResponse.RoleCredentials.SessionToken, immutableCredentials.Token);
            Assert.AreEqual(CoreAmazonSSOTestFixture.SampleExpiration, immutableCredentials.Expiration);

            _testFixture.AssertGetRoleCredentialsAsyncRequest(_testFixture.GetRoleCredentialsRequest);
        }
 Task <ImmutableCredentials> ICoreAmazonSSO.CredentialsFromSsoAccessTokenAsync(
     string accountId, string roleName, string accessToken,
     IDictionary <string, object> additionalProperties)
 {
     return(CoreAmazonSSO.CredentialsFromSsoAccessTokenAsync(this, accountId, roleName, accessToken, additionalProperties));
 }