amazonka-cognito-idp-1.5.0: Amazon Cognito Identity Provider SDK.

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

Network.AWS.CognitoIdentityProvider.InitiateAuth

Contents

Description

Initiates the authentication flow.

Synopsis

Creating a Request

initiateAuth Source #

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

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

  • iaClientMetadata - 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.
  • iaAuthParameters - 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 : USERNAME (required), SECRET_HASH (required if the app client is configured with a client secret), REFRESH_TOKEN (required), DEVICE_KEY * For CUSTOM_AUTH : USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY
  • iaAuthFlow - 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. 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 is not a valid value.
  • iaClientId - The app client ID.

data InitiateAuth Source #

Initiates the authentication request.

See: initiateAuth smart constructor.

Instances

Eq InitiateAuth Source # 
Data InitiateAuth Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InitiateAuth -> c InitiateAuth #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InitiateAuth #

toConstr :: InitiateAuth -> Constr #

dataTypeOf :: InitiateAuth -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c InitiateAuth) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InitiateAuth) #

gmapT :: (forall b. Data b => b -> b) -> InitiateAuth -> InitiateAuth #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InitiateAuth -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InitiateAuth -> r #

gmapQ :: (forall d. Data d => d -> u) -> InitiateAuth -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InitiateAuth -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InitiateAuth -> m InitiateAuth #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InitiateAuth -> m InitiateAuth #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InitiateAuth -> m InitiateAuth #

Show InitiateAuth Source # 
Generic InitiateAuth Source # 

Associated Types

type Rep InitiateAuth :: * -> * #

Hashable InitiateAuth Source # 
ToJSON InitiateAuth Source # 
NFData InitiateAuth Source # 

Methods

rnf :: InitiateAuth -> () #

AWSRequest InitiateAuth Source # 
ToQuery InitiateAuth Source # 
ToPath InitiateAuth Source # 
ToHeaders InitiateAuth Source # 
type Rep InitiateAuth Source # 
type Rep InitiateAuth = D1 (MetaData "InitiateAuth" "Network.AWS.CognitoIdentityProvider.InitiateAuth" "amazonka-cognito-idp-1.5.0-6L4ibyApQsq9OINZIpqhIF" False) (C1 (MetaCons "InitiateAuth'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_iaClientMetadata") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Map Text Text)))) (S1 (MetaSel (Just Symbol "_iaAuthParameters") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Map Text Text))))) ((:*:) (S1 (MetaSel (Just Symbol "_iaAuthFlow") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 AuthFlowType)) (S1 (MetaSel (Just Symbol "_iaClientId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Sensitive Text))))))
type Rs InitiateAuth Source # 

Request Lenses

iaClientMetadata :: Lens' InitiateAuth (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.

iaAuthParameters :: Lens' InitiateAuth (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 : USERNAME (required), SECRET_HASH (required if the app client is configured with a client secret), REFRESH_TOKEN (required), DEVICE_KEY * For CUSTOM_AUTH : USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY

iaAuthFlow :: Lens' InitiateAuth 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. 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 is not a valid value.

iaClientId :: Lens' InitiateAuth Text Source #

The app client ID.

Destructuring the Response

initiateAuthResponse Source #

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

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

  • iarsChallengeName - 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. Valid values include the following. Note that all of these challenges require USERNAME and SECRET_HASH (if applicable) in the parameters. * 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. * 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.
  • iarsChallengeParameters - The challenge parameters. These are returned to you in the InitiateAuth response if you need to pass another challenge. The responses in this parameter should be used to compute inputs to the next call (RespondToAuthChallenge ). All challenges require USERNAME and SECRET_HASH (if applicable).
  • iarsAuthenticationResult - 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.
  • iarsSession - The session which should be passed both ways in challenge-response calls to the service. If the InitiateAuth or RespondToAuthChallenge 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 RespondToAuthChallenge API call.
  • iarsResponseStatus - -- | The response status code.

data InitiateAuthResponse Source #

Initiates the authentication response.

See: initiateAuthResponse smart constructor.

Instances

Eq InitiateAuthResponse Source # 
Data InitiateAuthResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InitiateAuthResponse -> c InitiateAuthResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InitiateAuthResponse #

toConstr :: InitiateAuthResponse -> Constr #

dataTypeOf :: InitiateAuthResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c InitiateAuthResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InitiateAuthResponse) #

gmapT :: (forall b. Data b => b -> b) -> InitiateAuthResponse -> InitiateAuthResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InitiateAuthResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InitiateAuthResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> InitiateAuthResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InitiateAuthResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InitiateAuthResponse -> m InitiateAuthResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InitiateAuthResponse -> m InitiateAuthResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InitiateAuthResponse -> m InitiateAuthResponse #

Show InitiateAuthResponse Source # 
Generic InitiateAuthResponse Source # 
NFData InitiateAuthResponse Source # 

Methods

rnf :: InitiateAuthResponse -> () #

type Rep InitiateAuthResponse Source # 
type Rep InitiateAuthResponse = D1 (MetaData "InitiateAuthResponse" "Network.AWS.CognitoIdentityProvider.InitiateAuth" "amazonka-cognito-idp-1.5.0-6L4ibyApQsq9OINZIpqhIF" False) (C1 (MetaCons "InitiateAuthResponse'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_iarsChallengeName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ChallengeNameType))) (S1 (MetaSel (Just Symbol "_iarsChallengeParameters") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Map Text Text))))) ((:*:) (S1 (MetaSel (Just Symbol "_iarsAuthenticationResult") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe AuthenticationResultType))) ((:*:) (S1 (MetaSel (Just Symbol "_iarsSession") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_iarsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int))))))

Response Lenses

iarsChallengeName :: Lens' InitiateAuthResponse (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. Valid values include the following. Note that all of these challenges require USERNAME and SECRET_HASH (if applicable) in the parameters. * 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. * 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.

iarsChallengeParameters :: Lens' InitiateAuthResponse (HashMap Text Text) Source #

The challenge parameters. These are returned to you in the InitiateAuth response if you need to pass another challenge. The responses in this parameter should be used to compute inputs to the next call (RespondToAuthChallenge ). All challenges require USERNAME and SECRET_HASH (if applicable).

iarsAuthenticationResult :: Lens' InitiateAuthResponse (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.

iarsSession :: Lens' InitiateAuthResponse (Maybe Text) Source #

The session which should be passed both ways in challenge-response calls to the service. If the InitiateAuth or RespondToAuthChallenge 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 RespondToAuthChallenge API call.

iarsResponseStatus :: Lens' InitiateAuthResponse Int Source #

  • - | The response status code.