Пример #1
0
        public void CredentialsFromSsoAccessToken()
        {
            var credentials = CoreAmazonSSO.CredentialsFromSsoAccessToken(
                _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.AssertGetRoleCredentialsRequest(_testFixture.GetRoleCredentialsRequest);
        }
 ImmutableCredentials ICoreAmazonSSO.CredentialsFromSsoAccessToken(
     string accountId, string roleName, string accessToken,
     IDictionary <string, object> additionalProperties)
 {
     return(CoreAmazonSSO.CredentialsFromSsoAccessToken(this, accountId, roleName, accessToken, additionalProperties));
 }