private Amazon.SSO.Model.GetRoleCredentialsResponse CallAWSServiceOperation(IAmazonSSO client, Amazon.SSO.Model.GetRoleCredentialsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Single Sign-On", "GetRoleCredentials");
     try
     {
         #if DESKTOP
         return(client.GetRoleCredentials(request));
         #elif CORECLR
         return(client.GetRoleCredentialsAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
コード例 #2
0
        public static ImmutableCredentials CredentialsFromSsoAccessToken(IAmazonSSO client, string accountId,
                                                                         string roleName, string accessToken,
                                                                         IDictionary <string, object> additionalProperties)
        {
            var request = new GetRoleCredentialsRequest()
            {
                AccessToken = accessToken,
                AccountId   = accountId,
                RoleName    = roleName,
            };

            InternalSDKUtils.ApplyValues(request, additionalProperties);

            var response = client.GetRoleCredentials(request);

            DateTime credentialsExpiration =
                AWSSDKUtils.ConvertFromUnixEpochMilliseconds(response.RoleCredentials.Expiration);

            return(new SSOImmutableCredentials(
                       response.RoleCredentials.AccessKeyId,
                       response.RoleCredentials.SecretAccessKey,
                       response.RoleCredentials.SessionToken,
                       credentialsExpiration));
        }
コード例 #3
0
 internal ListAccountsPaginator(IAmazonSSO client, ListAccountsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
コード例 #4
0
 internal SSOPaginatorFactory(IAmazonSSO client)
 {
     this.client = client;
 }
コード例 #5
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            Client = CreateClient(_CurrentCredentials, _RegionEndpoint);
        }