public void SecurityTokenServiceGetFederationToken() { #region to-get-temporary-credentials-for-a-role-by-using-getfederationtoken-1480540749900 var response = client.GetFederationToken(new GetFederationTokenRequest { DurationSeconds = 3600, Name = "testFedUserSession", Policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:ListAllMyBuckets\",\"Resource\":\"*\"}]}", Tags = new List <Tag> { new Tag { Key = "Project", Value = "Pegasus" }, new Tag { Key = "Cost-Center", Value = "98765" } } }); Credentials credentials = response.Credentials; FederatedUser federatedUser = response.FederatedUser; int packedPolicySize = response.PackedPolicySize; #endregion }
public void SecurityTokenServiceGetFederationToken() { #region to-get-temporary-credentials-for-a-role-by-using-getfederationtoken-1480540749900 var response = client.GetFederationToken(new GetFederationTokenRequest { DurationSeconds = 3600, Name = "Bob", Policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:*\",\"Resource\":\"*\"}]}" }); Credentials credentials = response.Credentials; FederatedUser federatedUser = response.FederatedUser; integer packedPolicySize = response.PackedPolicySize; #endregion }
private Amazon.SecurityToken.Model.GetFederationTokenResponse CallAWSServiceOperation(IAmazonSecurityTokenService client, Amazon.SecurityToken.Model.GetFederationTokenRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Security Token Service (STS)", "GetFederationToken"); try { #if DESKTOP return(client.GetFederationToken(request)); #elif CORECLR return(client.GetFederationTokenAsync(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; } }