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.AdminInitiateAuth

Contents

Description

Initiates the authentication flow, as an administrator.

Requires developer credentials.

Synopsis

Creating a Request

adminInitiateAuth Source #

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.
  • aiaAuthParameters - 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 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 - 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 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 : Non-SRP authentication flow; you can pass in the USERNAME and PASSWORD directly if the flow is enabled for calling the app client.

data AdminInitiateAuth Source #

Initiates the authorization request, as an administrator.

See: adminInitiateAuth smart constructor.

Instances

Eq AdminInitiateAuth Source # 
Data AdminInitiateAuth Source # 

Methods

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

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

toConstr :: AdminInitiateAuth -> Constr #

dataTypeOf :: AdminInitiateAuth -> DataType #

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

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

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

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

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

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

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

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

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

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

Show AdminInitiateAuth Source # 
Generic AdminInitiateAuth Source # 
Hashable AdminInitiateAuth Source # 
ToJSON AdminInitiateAuth Source # 
NFData AdminInitiateAuth Source # 

Methods

rnf :: AdminInitiateAuth -> () #

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

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.

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 : USERNAME (required), SECRET_HASH (required if the app client is configured with a client secret), REFRESH_TOKEN (required), 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.

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. 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.

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 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 - 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_IF_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 - 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 - 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 - -- | The response status code.

data AdminInitiateAuthResponse Source #

Initiates the authentication response, as an administrator.

See: adminInitiateAuthResponse smart constructor.

Instances

Eq AdminInitiateAuthResponse Source # 
Data AdminInitiateAuthResponse Source # 

Methods

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

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

toConstr :: AdminInitiateAuthResponse -> Constr #

dataTypeOf :: AdminInitiateAuthResponse -> DataType #

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

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

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

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

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

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

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

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

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

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

Show AdminInitiateAuthResponse Source # 
Generic AdminInitiateAuthResponse Source # 
NFData AdminInitiateAuthResponse Source # 
type Rep AdminInitiateAuthResponse Source # 
type Rep AdminInitiateAuthResponse = D1 (MetaData "AdminInitiateAuthResponse" "Network.AWS.CognitoIdentityProvider.AdminInitiateAuth" "amazonka-cognito-idp-1.5.0-6L4ibyApQsq9OINZIpqhIF" False) (C1 (MetaCons "AdminInitiateAuthResponse'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_aiarsChallengeName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe ChallengeNameType))) (S1 (MetaSel (Just Symbol "_aiarsChallengeParameters") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (Map Text Text))))) ((:*:) (S1 (MetaSel (Just Symbol "_aiarsAuthenticationResult") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe AuthenticationResultType))) ((:*:) (S1 (MetaSel (Just Symbol "_aiarsSession") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_aiarsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int))))))

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_IF_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.