Esempio n. 1
0
        /// <summary>
        /// Constructs an GoogleCompatCredentials object.
        /// </summary>
        /// <param name="sourceCredentials">The Google credential that implements Google.Apis.Auth.OAuth2.IOidcTokenProvider.</param>
        /// <param name="targetAudience">The audience value for the GoogleOIDC Token.</param>
        /// <param name="assumeRoleWithWebIdentityRequest">AssumeRoleWithWebIdentityRequest structure that specifies the Arn, SessionName.</param>
        /// <param name="options">Options to be used in the call to AssumeRole. Not implemented!</param>
        public GoogleCompatCredentials(Google.Apis.Auth.OAuth2.IOidcTokenProvider sourceCredentials, string targetAudience, AssumeRoleWithWebIdentityRequest wr, AssumeRoleAWSCredentialsOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            SourceCredentials = sourceCredentials;
            TargetAudience    = defaultTargetAudience;
            if (targetAudience != "")
            {
                TargetAudience = targetAudience;
            }

            TargetAssumeRoleRequest = wr;
            Options = options;
            // Make sure to fetch new credentials well before the current credentials expire to avoid
            // any request being made with expired credentials.
            PreemptExpiryTime = TimeSpan.FromMinutes(5);
        }
Esempio n. 2
0
 /// <summary>
 /// Constructs an GoogleCompatCredentials object.
 /// </summary>
 /// <param name="sourceCredentials">The Google credential that implements Google.Apis.Auth.OAuth2.IOidcTokenProvider.</param>
 /// <param name="targetAudience">The audience value for the GoogleOIDC Token.</param>
 /// <param name="assumeRoleWithWebIdentityRequest">AssumeRoleWithWebIdentityRequest structure that specifies the Arn, SessionName.</param>
 public GoogleCompatCredentials(Google.Apis.Auth.OAuth2.IOidcTokenProvider sourceCredentials, string targetAudience, AssumeRoleWithWebIdentityRequest wr)
     : this(sourceCredentials, targetAudience, wr, new AssumeRoleAWSCredentialsOptions())
 {
 }