amazonka-sts-1.3.4: Amazon Security Token Service SDK.

Copyright(c) 2013-2015 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.STS

Contents

Description

AWS Security Token Service

The AWS Security Token Service (STS) is a web service that enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users). This guide provides descriptions of the STS API. For more detailed information about using this service, go to Using Temporary Security Credentials.

As an alternative to using the API, you can use one of the AWS SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to STS. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the Tools for Amazon Web Services page.

For information about setting up signatures and authorization through the API, go to Signing AWS API Requests in the AWS General Reference. For general information about the Query API, go to Making Query Requests in Using IAM. For information about using security tokens with other AWS products, go to Using Temporary Security Credentials to Access AWS in Using Temporary Security Credentials.

If you're new to AWS and need additional technical information about a specific AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/.

Endpoints

The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com that maps to the US East (N. Virginia) region. Additional regions are available, but must first be activated in the AWS Management Console before you can use a different region's endpoint. For more information about activating a region for STS see Activating STS in a New Region in the Using Temporary Security Credentials guide.

For information about STS endpoints, see Regions and Endpoints in the AWS General Reference.

Recording API requests

STS supports AWS CloudTrail, which is a service that records AWS calls for your AWS account and delivers log files to an Amazon S3 bucket. By using information collected by CloudTrail, you can determine what requests were successfully made to STS, who made the request, when it was made, and so on. To learn more about CloudTrail, including how to turn it on and find your log files, see the AWS CloudTrail User Guide.

See: AWS API Reference

Synopsis

Service Configuration

sTS :: Service Source

API version '2011-06-15' of the Amazon Security Token Service SDK configuration.

Errors

Error matchers are designed for use with the functions provided by Control.Exception.Lens. This allows catching (and rethrowing) service specific errors returned by STS.

MalformedPolicyDocumentException

_MalformedPolicyDocumentException :: AsError a => Getting (First ServiceError) a ServiceError Source

The request was rejected because the policy document was malformed. The error message describes the specific error.

InvalidAuthorizationMessageException

_InvalidAuthorizationMessageException :: AsError a => Getting (First ServiceError) a ServiceError Source

The error returned if the message passed to DecodeAuthorizationMessage was invalid. This can happen if the token contains invalid characters, such as linebreaks.

PackedPolicyTooLargeException

_PackedPolicyTooLargeException :: AsError a => Getting (First ServiceError) a ServiceError Source

The request was rejected because the policy document was too large. The error message describes how big the policy document is, in packed form, as a percentage of what the API allows.

IdPCommunicationErrorException

_IdPCommunicationErrorException :: AsError a => Getting (First ServiceError) a ServiceError Source

The request could not be fulfilled because the non-AWS identity provider (IDP) that was asked to verify the incoming identity token could not be reached. This is often a transient error caused by network conditions. Retry the request a limited number of times so that you don't exceed the request rate. If the error persists, the non-AWS identity provider might be down or not responding.

InvalidIdentityTokenException

_InvalidIdentityTokenException :: AsError a => Getting (First ServiceError) a ServiceError Source

The web identity token that was passed could not be validated by AWS. Get a new identity token from the identity provider and then retry the request.

ExpiredTokenException

_ExpiredTokenException :: AsError a => Getting (First ServiceError) a ServiceError Source

The web identity token that was passed is expired or is not valid. Get a new identity token from the identity provider and then retry the request.

IdPRejectedClaimException

_IdPRejectedClaimException :: AsError a => Getting (First ServiceError) a ServiceError Source

The identity provider (IdP) reported that authentication failed. This might be because the claim is invalid.

If this error is returned for the AssumeRoleWithWebIdentity operation, it can also mean that the claim has expired or has been explicitly revoked.

Waiters

Waiters poll by repeatedly sending a request until some remote success condition configured by the Wait specification is fulfilled. The Wait specification determines how many attempts should be made, in addition to delay and retry strategies.

Operations

Some AWS operations return results that are incomplete and require subsequent requests in order to obtain the entire result set. The process of sending subsequent requests to continue where a previous request left off is called pagination. For example, the ListObjects operation of Amazon S3 returns up to 1000 objects at a time, and you must send subsequent requests with the appropriate Marker in order to retrieve the next page of results.

Operations that have an AWSPager instance can transparently perform subsequent requests, correctly setting Markers and other request facets to iterate through the entire result set of a truncated API operation. Operations which support this have an additional note in the documentation.

Many operations have the ability to filter results on the server side. See the individual operation parameters for details.

AssumeRole

DecodeAuthorizationMessage

AssumeRoleWithWebIdentity

GetFederationToken

GetSessionToken

AssumeRoleWithSAML

Types

AssumedRoleUser

data AssumedRoleUser Source

The identifiers for the temporary security credentials that the operation returns.

See: assumedRoleUser smart constructor.

assumedRoleUser Source

Creates a value of AssumedRoleUser with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

aruAssumedRoleId :: Lens' AssumedRoleUser Text Source

A unique identifier that contains the role ID and the role session name of the role that is being assumed. The role ID is generated by AWS when the role is created.

aruARN :: Lens' AssumedRoleUser Text Source

The ARN of the temporary security credentials that are returned from the AssumeRole action. For more information about ARNs and how to use them in policies, see IAM Identifiers in Using IAM.

Credentials

credentials Source

Creates a value of Credentials with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

cAccessKeyId :: Lens' Credentials Text Source

The access key ID that identifies the temporary security credentials.

cSecretAccessKey :: Lens' Credentials Text Source

The secret access key that can be used to sign requests.

cSessionToken :: Lens' Credentials Text Source

The token that users must pass to the service API to use the temporary credentials.

cExpiration :: Lens' Credentials UTCTime Source

The date on which the current credentials expire.

FederatedUser

data FederatedUser Source

Identifiers for the federated user that is associated with the credentials.

See: federatedUser smart constructor.

federatedUser Source

Creates a value of FederatedUser with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

fuFederatedUserId :: Lens' FederatedUser Text Source

The string that identifies the federated user associated with the credentials, similar to the unique ID of an IAM user.

fuARN :: Lens' FederatedUser Text Source

The ARN that specifies the federated user that is associated with the credentials. For more information about ARNs and how to use them in policies, see IAM Identifiers in Using IAM.