using System;
using System.Net;
#if AWS_ASYNC_API
using System.Threading.Tasks;
#endif
namespace Amazon.Runtime.SharedInterfaces
{
///
/// ICoreAmazonSTS is not meant to be used directly. It defines Security Token
/// service with basic .NET types and allows other services to be able to use the service as
/// a runtime dependency. This interface is implemented by the AmazonSecurityTokenServiceClient
/// defined in the AWSSDK.SecurityToken assembly.
///
public interface ICoreAmazonSTS
{
///
///
/// This method is used internally to access the Amazon Security Token
/// service within other service assemblies.
/// Please use AmazonSecurityTokenServiceClient to access the Amazon Security Token
/// service instead.
///
/// Use Amazon Security Token Service to assume a role.
///
/// Proxy settings that are required for the HTTPS and STS calls made during the authentication/credential
/// generation process are supported and should have been configured on the STS ClientConfig instance
/// associated with the STS client instance exposing this interface.
///
///
/// The Amazon Resource Name (ARN) of the role to assume.
/// An identifier for the assumed role session.
/// Options to be used in the call to AssumeRole.
///
AssumeRoleImmutableCredentials CredentialsFromAssumeRoleAuthentication(string roleArn, string roleSessionName, AssumeRoleAWSCredentialsOptions options);
#if !BCL // In the NETSTANDARD flavors of the SDK ICoreAmazonSTS is declared without CredentialsFromSAMLAuthentication,
} // we cannot add a new method to the interface for backward compatibility concerns.
///
/// ICoreAmazonSTS_SAML is not meant to be used directly. It defines Security Token
/// service with basic .NET types and allows other services to be able to use the service as
/// a runtime dependency. This interface is implemented by the AmazonSecurityTokenServiceClient
/// defined in the AWSSDK.SecurityToken assembly.
///
public interface ICoreAmazonSTS_SAML
{
#endif
///
///
/// This method is used internally to access the Amazon Security Token
/// service within other service assemblies.
/// Please use AmazonSecurityTokenServiceClient to access the Amazon Security Token
/// service instead.
///
/// Authenticates against a federated identity endpoint supporting SAML and returns
/// temporary AWS credentials for the supplied role.
///
/// The endpoint for the federated identity provider
/// The authentication type to use (NTLM, Kerberos etc)
/// The ARN of the role the user is to assume following authentication
/// TTL duration for the generated credentials.
///
/// Optional; alternate user credential for authentication. If null the identity of the
/// current process is used.
///
/// Generated credential data, including SAML-related information such as subject.
///
/// Proxy settings that are required for the HTTPS and STS calls made during the authentication/credential
/// generation process are supported and should have been configured on the STS ClientConfig instance
/// associated with the STS client instance exposing this interface.
///
SAMLImmutableCredentials CredentialsFromSAMLAuthentication(string endpoint,
string authenticationType,
string roleARN,
TimeSpan credentialDuration,
ICredentials userCredential);
}
public interface ICoreAmazonSTS_WebIdentity : IDisposable
{
///
///
/// This method is used internally to access the Amazon Security Token
/// service within other service assemblies.
/// Please use AmazonSecurityTokenServiceClient to access the Amazon Security Token
/// service instead.
///
/// Use Amazon Security Token Service to assume a role.
///
/// Proxy settings that are required for the HTTPS and STS calls made during the authentication/credential
/// generation process are supported and should have been configured on the STS ClientConfig instance
/// associated with the STS client instance exposing this interface.
///
///
/// The web identity token used to assume the role.
/// The Amazon Resource Name (ARN) of the role to assume.
/// An identifier for the assumed role session.
/// Options to be used in the call to AssumeRoleWithWebIdentity
///
AssumeRoleImmutableCredentials CredentialsFromAssumeRoleWithWebIdentityAuthentication(string webIdentityToken, string roleArn, string roleSessionName, AssumeRoleWithWebIdentityCredentialsOptions options);
#if AWS_ASYNC_API
///
///
/// This method is used internally to access the Amazon Security Token
/// service within other service assemblies.
/// Please use AmazonSecurityTokenServiceClient to access the Amazon Security Token
/// service instead.
///
/// Use Amazon Security Token Service to assume a role.
///
/// Proxy settings that are required for the HTTPS and STS calls made during the authentication/credential
/// generation process are supported and should have been configured on the STS ClientConfig instance
/// associated with the STS client instance exposing this interface.
///
///
/// The web identity token used to assume the role.
/// The Amazon Resource Name (ARN) of the role to assume.
/// An identifier for the assumed role session.
/// Options to be used in the call to AssumeRoleWithWebIdentity
///
Task CredentialsFromAssumeRoleWithWebIdentityAuthenticationAsync(string webIdentityToken, string roleArn, string roleSessionName, AssumeRoleWithWebIdentityCredentialsOptions options);
#endif
}
}