-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-loadcredentials
- Loading branch information
Showing
7 changed files
with
437 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
..._that_Custom_Auth_signIn_invokes_proper_cognito_request_and_returns_custom_challenge.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"description": "Test that Custom Auth signIn invokes proper cognito request and returns custom challenge", | ||
"preConditions": { | ||
"amplify-configuration": "authconfiguration.json", | ||
"state": "SignedOut_Configured.json", | ||
"mockedResponses": [ | ||
{ | ||
"type": "cognitoIdentityProvider", | ||
"apiName": "initiateAuth", | ||
"responseType": "success", | ||
"response": { | ||
"challengeName": "CUSTOM_CHALLENGE", | ||
"challengeParameters": { | ||
"SALT": "abc", | ||
"SECRET_BLOCK": "secretBlock", | ||
"SRP_B": "def", | ||
"USERNAME": "username" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "cognitoIdentityProvider", | ||
"apiName": "respondToAuthChallenge", | ||
"responseType": "success", | ||
"response": { | ||
"session": "someSession", | ||
"challengeName": "CUSTOM_CHALLENGE", | ||
"challengeParameters": { | ||
"SALT": "abc", | ||
"SECRET_BLOCK": "secretBlock", | ||
"SRP_B": "def", | ||
"USERNAME": "username" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"api": { | ||
"name": "signIn", | ||
"params": { | ||
"username": "username", | ||
"password": "" | ||
}, | ||
"options": { | ||
"signInOptions": { | ||
"authFlow": "CUSTOM_AUTH_WITHOUT_SRP" | ||
} | ||
} | ||
}, | ||
"validations": [ | ||
{ | ||
"type": "amplify", | ||
"apiName": "signIn", | ||
"responseType": "success", | ||
"response": { | ||
"isSignedIn": false, | ||
"nextStep": { | ||
"signInStep": "CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE", | ||
"additionalInfo": { | ||
"SALT": "abc", | ||
"SECRET_BLOCK": "secretBlock", | ||
"SRP_B": "def", | ||
"USERNAME": "username" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "state", | ||
"expectedState": "CustomSignIn_SigningIn.json" | ||
} | ||
] | ||
} |
74 changes: 74 additions & 0 deletions
74
...hat_Custom_Auth_signIn_invokes_proper_cognito_request_and_returns_password_challenge.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"description": "Test that Custom Auth signIn invokes proper cognito request and returns password challenge", | ||
"preConditions": { | ||
"amplify-configuration": "authconfiguration.json", | ||
"state": "SignedOut_Configured.json", | ||
"mockedResponses": [ | ||
{ | ||
"type": "cognitoIdentityProvider", | ||
"apiName": "initiateAuth", | ||
"responseType": "success", | ||
"response": { | ||
"challengeName": "PASSWORD_VERIFIER", | ||
"challengeParameters": { | ||
"SALT": "abc", | ||
"SECRET_BLOCK": "secretBlock", | ||
"SRP_B": "def", | ||
"USERNAME": "username", | ||
"USER_ID_FOR_SRP": "userId" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "cognitoIdentityProvider", | ||
"apiName": "respondToAuthChallenge", | ||
"responseType": "success", | ||
"response": { | ||
"session": "someSession", | ||
"challengeName": "CUSTOM_CHALLENGE", | ||
"challengeParameters": { | ||
"SALT": "abc", | ||
"SECRET_BLOCK": "secretBlock", | ||
"SRP_B": "def", | ||
"USERNAME": "username" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"api": { | ||
"name": "signIn", | ||
"params": { | ||
"username": "username", | ||
"password": "" | ||
}, | ||
"options": { | ||
"signInOptions": { | ||
"authFlow": "CUSTOM_AUTH_WITH_SRP" | ||
} | ||
} | ||
}, | ||
"validations": [ | ||
{ | ||
"type": "amplify", | ||
"apiName": "signIn", | ||
"responseType": "success", | ||
"response": { | ||
"isSignedIn": false, | ||
"nextStep": { | ||
"signInStep": "CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE", | ||
"additionalInfo": { | ||
"SALT": "abc", | ||
"SECRET_BLOCK": "secretBlock", | ||
"SRP_B": "def", | ||
"USERNAME": "username" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "state", | ||
"expectedState": "CustomSignIn_SigningIn.json" | ||
} | ||
] | ||
} |
97 changes: 97 additions & 0 deletions
97
...ignIn/Test_that_Device_SRP_signIn_invokes_proper_cognito_request_and_returns_success.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"description": "Test that Device SRP signIn invokes proper cognito request and returns success", | ||
"preConditions": { | ||
"amplify-configuration": "authconfiguration.json", | ||
"state": "SignedOut_Configured.json", | ||
"mockedResponses": [ | ||
{ | ||
"type": "cognitoIdentityProvider", | ||
"apiName": "initiateAuth", | ||
"responseType": "success", | ||
"response": { | ||
"challengeName": "PASSWORD_VERIFIER", | ||
"challengeParameters": { | ||
"SALT": "abc", | ||
"SECRET_BLOCK": "secretBlock", | ||
"SRP_B": "def", | ||
"USERNAME": "username", | ||
"USER_ID_FOR_SRP": "userId" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "cognitoIdentityProvider", | ||
"apiName": "respondToAuthChallenge", | ||
"responseType": "success", | ||
"response": { | ||
"authenticationResult": { | ||
"idToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU", | ||
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU", | ||
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU", | ||
"expiresIn": 300, | ||
"newDeviceMetadata": { | ||
"deviceKey": "someDeviceKey", | ||
"deviceGroupKey": "someDeviceGroupKey" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "cognitoIdentityProvider", | ||
"apiName": "confirmDevice", | ||
"responseType": "success", | ||
"response": { | ||
} | ||
}, | ||
{ | ||
"type": "cognitoIdentity", | ||
"apiName": "getId", | ||
"responseType": "success", | ||
"response": { | ||
"identityId": "someIdentityId" | ||
} | ||
}, | ||
{ | ||
"type": "cognitoIdentity", | ||
"apiName": "getCredentialsForIdentity", | ||
"responseType": "success", | ||
"response": { | ||
"credentials": { | ||
"accessKeyId": "someAccessKey", | ||
"secretKey": "someSecretKey", | ||
"sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VySWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZXhwIjoxNTE2MjM5MDIyLCJvcmlnaW5fanRpIjoib3JpZ2luX2p0aSJ9.Xqa-vjJe5wwwsqeRAdHf8kTBn_rYSkDn2lB7xj9Z1xU", | ||
"expiration": 2342134 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"api": { | ||
"name": "signIn", | ||
"params": { | ||
"username": "username", | ||
"password": "password" | ||
}, | ||
"options": { | ||
} | ||
}, | ||
"validations": [ | ||
{ | ||
"type": "amplify", | ||
"apiName": "signIn", | ||
"responseType": "success", | ||
"response": { | ||
"isSignedIn": true, | ||
"nextStep": { | ||
"signInStep": "DONE", | ||
"additionalInfo": { | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "state", | ||
"expectedState": "SignedIn_SessionEstablished.json" | ||
} | ||
] | ||
} |
Oops, something went wrong.