Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Initiates the authentication flow, as an administrator.
Requires developer credentials.
- adminInitiateAuth :: Text -> Text -> AuthFlowType -> AdminInitiateAuth
- data AdminInitiateAuth
- aiaClientMetadata :: Lens' AdminInitiateAuth (HashMap Text Text)
- aiaContextData :: Lens' AdminInitiateAuth (Maybe ContextDataType)
- aiaAnalyticsMetadata :: Lens' AdminInitiateAuth (Maybe AnalyticsMetadataType)
- aiaAuthParameters :: Lens' AdminInitiateAuth (HashMap Text Text)
- aiaUserPoolId :: Lens' AdminInitiateAuth Text
- aiaClientId :: Lens' AdminInitiateAuth Text
- aiaAuthFlow :: Lens' AdminInitiateAuth AuthFlowType
- adminInitiateAuthResponse :: Int -> AdminInitiateAuthResponse
- data AdminInitiateAuthResponse
- aiarsChallengeName :: Lens' AdminInitiateAuthResponse (Maybe ChallengeNameType)
- aiarsChallengeParameters :: Lens' AdminInitiateAuthResponse (HashMap Text Text)
- aiarsAuthenticationResult :: Lens' AdminInitiateAuthResponse (Maybe AuthenticationResultType)
- aiarsSession :: Lens' AdminInitiateAuthResponse (Maybe Text)
- aiarsResponseStatus :: Lens' AdminInitiateAuthResponse Int
Creating a Request
Creates a value of AdminInitiateAuth
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
aiaClientMetadata
- This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda trigger as-is. It can be used to implement additional validations around authentication.aiaContextData
- Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.aiaAnalyticsMetadata
- The analytics metadata for collecting Amazon Pinpoint metrics forAdminInitiateAuth
calls.aiaAuthParameters
- The authentication parameters. These are inputs corresponding to theAuthFlow
that you are invoking. The required values depend on the value ofAuthFlow
: * ForUSER_SRP_AUTH
:USERNAME
(required),SRP_A
(required),SECRET_HASH
(required if the app client is configured with a client secret),DEVICE_KEY
* ForREFRESH_TOKEN_AUTH/REFRESH_TOKEN
:REFRESH_TOKEN
(required),SECRET_HASH
(required if the app client is configured with a client secret),DEVICE_KEY
* ForADMIN_NO_SRP_AUTH
:USERNAME
(required),SECRET_HASH
(if app client is configured with client secret),PASSWORD
(required),DEVICE_KEY
* ForCUSTOM_AUTH
:USERNAME
(required),SECRET_HASH
(if app client is configured with client secret),DEVICE_KEY
aiaUserPoolId
- The ID of the Amazon Cognito user pool.aiaClientId
- The app client ID.aiaAuthFlow
- The authentication flow for this call to execute. The API action will depend on this value. For example: *REFRESH_TOKEN_AUTH
will take in a valid refresh token and return new tokens. *USER_SRP_AUTH
will take inUSERNAME
andSRP_A
and return the SRP variables to be used for next challenge execution. *USER_PASSWORD_AUTH
will take inUSERNAME
andPASSWORD
and return the next challenge or tokens. Valid values include: *USER_SRP_AUTH
: Authentication flow for the Secure Remote Password (SRP) protocol. *REFRESH_TOKEN_AUTH
/REFRESH_TOKEN
: Authentication flow for refreshing the access token and ID token by supplying a valid refresh token. *CUSTOM_AUTH
: Custom authentication flow. *ADMIN_NO_SRP_AUTH
: Non-SRP authentication flow; you can pass in the USERNAME and PASSWORD directly if the flow is enabled for calling the app client. *USER_PASSWORD_AUTH
: Non-SRP authentication flow; USERNAME and PASSWORD are passed directly. If a user migration Lambda trigger is set, this flow will invoke the user migration Lambda if the USERNAME is not found in the user pool.
data AdminInitiateAuth Source #
Initiates the authorization request, as an administrator.
See: adminInitiateAuth
smart constructor.
Request Lenses
aiaClientMetadata :: Lens' AdminInitiateAuth (HashMap Text Text) Source #
This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda trigger as-is. It can be used to implement additional validations around authentication.
aiaContextData :: Lens' AdminInitiateAuth (Maybe ContextDataType) Source #
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
aiaAnalyticsMetadata :: Lens' AdminInitiateAuth (Maybe AnalyticsMetadataType) Source #
The analytics metadata for collecting Amazon Pinpoint metrics for AdminInitiateAuth
calls.
aiaAuthParameters :: Lens' AdminInitiateAuth (HashMap Text Text) Source #
The authentication parameters. These are inputs corresponding to the AuthFlow
that you are invoking. The required values depend on the value of AuthFlow
: * For USER_SRP_AUTH
: USERNAME
(required), SRP_A
(required), SECRET_HASH
(required if the app client is configured with a client secret), DEVICE_KEY
* For REFRESH_TOKEN_AUTH/REFRESH_TOKEN
: REFRESH_TOKEN
(required), SECRET_HASH
(required if the app client is configured with a client secret), DEVICE_KEY
* For ADMIN_NO_SRP_AUTH
: USERNAME
(required), SECRET_HASH
(if app client is configured with client secret), PASSWORD
(required), DEVICE_KEY
* For CUSTOM_AUTH
: USERNAME
(required), SECRET_HASH
(if app client is configured with client secret), DEVICE_KEY
aiaUserPoolId :: Lens' AdminInitiateAuth Text Source #
The ID of the Amazon Cognito user pool.
aiaClientId :: Lens' AdminInitiateAuth Text Source #
The app client ID.
aiaAuthFlow :: Lens' AdminInitiateAuth AuthFlowType Source #
The authentication flow for this call to execute. The API action will depend on this value. For example: * REFRESH_TOKEN_AUTH
will take in a valid refresh token and return new tokens. * USER_SRP_AUTH
will take in USERNAME
and SRP_A
and return the SRP variables to be used for next challenge execution. * USER_PASSWORD_AUTH
will take in USERNAME
and PASSWORD
and return the next challenge or tokens. Valid values include: * USER_SRP_AUTH
: Authentication flow for the Secure Remote Password (SRP) protocol. * REFRESH_TOKEN_AUTH
/REFRESH_TOKEN
: Authentication flow for refreshing the access token and ID token by supplying a valid refresh token. * CUSTOM_AUTH
: Custom authentication flow. * ADMIN_NO_SRP_AUTH
: Non-SRP authentication flow; you can pass in the USERNAME and PASSWORD directly if the flow is enabled for calling the app client. * USER_PASSWORD_AUTH
: Non-SRP authentication flow; USERNAME and PASSWORD are passed directly. If a user migration Lambda trigger is set, this flow will invoke the user migration Lambda if the USERNAME is not found in the user pool.
Destructuring the Response
adminInitiateAuthResponse Source #
Creates a value of AdminInitiateAuthResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
aiarsChallengeName
- The name of the challenge which you are responding to with this call. This is returned to you in theAdminInitiateAuth
response if you need to pass another challenge. *SMS_MFA
: Next challenge is to supply anSMS_MFA_CODE
, delivered via SMS. *PASSWORD_VERIFIER
: Next challenge is to supplyPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
after the client-side SRP calculations. *CUSTOM_CHALLENGE
: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. *DEVICE_SRP_AUTH
: If device tracking was enabled on your user pool and the previous challenges were passed, this challenge is returned so that Amazon Cognito can start tracking this device. *DEVICE_PASSWORD_VERIFIER
: Similar toPASSWORD_VERIFIER
, but for devices only. *ADMIN_NO_SRP_AUTH
: This is returned if you need to authenticate withUSERNAME
andPASSWORD
directly. An app client must be enabled to use this flow. *NEW_PASSWORD_REQUIRED
: For users which are required to change their passwords after successful first login. This challenge should be passed withNEW_PASSWORD
and any other required attributes.aiarsChallengeParameters
- The challenge parameters. These are returned to you in theAdminInitiateAuth
response if you need to pass another challenge. The responses in this parameter should be used to compute inputs to the next call (AdminRespondToAuthChallenge
). All challenges requireUSERNAME
andSECRET_HASH
(if applicable). The value of theUSER_ID_FOR_SRP
attribute will be the user's actual username, not an alias (such as email address or phone number), even if you specified an alias in your call toAdminInitiateAuth
. This is because, in theAdminRespondToAuthChallenge
APIChallengeResponses
, theUSERNAME
attribute cannot be an alias.aiarsAuthenticationResult
- The result of the authentication response. This is only returned if the caller does not need to pass another challenge. If the caller does need to pass another challenge before it gets tokens,ChallengeName
,ChallengeParameters
, andSession
are returned.aiarsSession
- The session which should be passed both ways in challenge-response calls to the service. IfAdminInitiateAuth
orAdminRespondToAuthChallenge
API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the nextAdminRespondToAuthChallenge
API call.aiarsResponseStatus
- -- | The response status code.
data AdminInitiateAuthResponse Source #
Initiates the authentication response, as an administrator.
See: adminInitiateAuthResponse
smart constructor.
Response Lenses
aiarsChallengeName :: Lens' AdminInitiateAuthResponse (Maybe ChallengeNameType) Source #
The name of the challenge which you are responding to with this call. This is returned to you in the AdminInitiateAuth
response if you need to pass another challenge. * SMS_MFA
: Next challenge is to supply an SMS_MFA_CODE
, delivered via SMS. * PASSWORD_VERIFIER
: Next challenge is to supply PASSWORD_CLAIM_SIGNATURE
, PASSWORD_CLAIM_SECRET_BLOCK
, and TIMESTAMP
after the client-side SRP calculations. * CUSTOM_CHALLENGE
: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued. * DEVICE_SRP_AUTH
: If device tracking was enabled on your user pool and the previous challenges were passed, this challenge is returned so that Amazon Cognito can start tracking this device. * DEVICE_PASSWORD_VERIFIER
: Similar to PASSWORD_VERIFIER
, but for devices only. * ADMIN_NO_SRP_AUTH
: This is returned if you need to authenticate with USERNAME
and PASSWORD
directly. An app client must be enabled to use this flow. * NEW_PASSWORD_REQUIRED
: For users which are required to change their passwords after successful first login. This challenge should be passed with NEW_PASSWORD
and any other required attributes.
aiarsChallengeParameters :: Lens' AdminInitiateAuthResponse (HashMap Text Text) Source #
The challenge parameters. These are returned to you in the AdminInitiateAuth
response if you need to pass another challenge. The responses in this parameter should be used to compute inputs to the next call (AdminRespondToAuthChallenge
). All challenges require USERNAME
and SECRET_HASH
(if applicable). The value of the USER_ID_FOR_SRP
attribute will be the user's actual username, not an alias (such as email address or phone number), even if you specified an alias in your call to AdminInitiateAuth
. This is because, in the AdminRespondToAuthChallenge
API ChallengeResponses
, the USERNAME
attribute cannot be an alias.
aiarsAuthenticationResult :: Lens' AdminInitiateAuthResponse (Maybe AuthenticationResultType) Source #
The result of the authentication response. This is only returned if the caller does not need to pass another challenge. If the caller does need to pass another challenge before it gets tokens, ChallengeName
, ChallengeParameters
, and Session
are returned.
aiarsSession :: Lens' AdminInitiateAuthResponse (Maybe Text) Source #
The session which should be passed both ways in challenge-response calls to the service. If AdminInitiateAuth
or AdminRespondToAuthChallenge
API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next AdminRespondToAuthChallenge
API call.
aiarsResponseStatus :: Lens' AdminInitiateAuthResponse Int Source #
- - | The response status code.