@aws-amplify/auth 6.7.1-unstable.ab33a03.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client/apis/associateWebAuthnCredential.js +62 -0
- package/dist/cjs/client/apis/associateWebAuthnCredential.js.map +1 -0
- package/dist/cjs/client/apis/deleteWebAuthnCredential.js +22 -0
- package/dist/cjs/client/apis/deleteWebAuthnCredential.js.map +1 -0
- package/dist/cjs/client/apis/index.js +13 -0
- package/dist/cjs/client/apis/index.js.map +1 -0
- package/dist/cjs/client/apis/listWebAuthnCredentials.js +23 -0
- package/dist/cjs/client/apis/listWebAuthnCredentials.js.map +1 -0
- package/dist/cjs/client/flows/shared/handlePasswordSRP.js +79 -0
- package/dist/cjs/client/flows/shared/handlePasswordSRP.js.map +1 -0
- package/dist/cjs/client/flows/userAuth/handleSelectChallenge.js +46 -0
- package/dist/cjs/client/flows/userAuth/handleSelectChallenge.js.map +1 -0
- package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPassword.js +59 -0
- package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPassword.js.map +1 -0
- package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.js +74 -0
- package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.js.map +1 -0
- package/dist/cjs/client/flows/userAuth/handleUserAuthFlow.js +84 -0
- package/dist/cjs/client/flows/userAuth/handleUserAuthFlow.js.map +1 -0
- package/dist/cjs/client/flows/userAuth/handleWebAuthnSignInResult.js +88 -0
- package/dist/cjs/client/flows/userAuth/handleWebAuthnSignInResult.js.map +1 -0
- package/dist/cjs/client/utils/index.js +9 -0
- package/dist/cjs/client/utils/index.js.map +1 -0
- package/dist/cjs/client/utils/passkey/errors.js +180 -0
- package/dist/cjs/client/utils/passkey/errors.js.map +1 -0
- package/dist/cjs/client/utils/passkey/getIsPasskeySupported.js +20 -0
- package/dist/cjs/client/utils/passkey/getIsPasskeySupported.js.map +1 -0
- package/dist/cjs/client/utils/passkey/getIsPasskeySupported.native.js +12 -0
- package/dist/cjs/client/utils/passkey/getIsPasskeySupported.native.js.map +1 -0
- package/dist/cjs/client/utils/passkey/getPasskey.js +27 -0
- package/dist/cjs/client/utils/passkey/getPasskey.js.map +1 -0
- package/dist/cjs/client/utils/passkey/getPasskey.native.js +12 -0
- package/dist/cjs/client/utils/passkey/getPasskey.native.js.map +1 -0
- package/dist/cjs/client/utils/passkey/index.js +11 -0
- package/dist/cjs/client/utils/passkey/index.js.map +1 -0
- package/dist/cjs/client/utils/passkey/registerPasskey.js +32 -0
- package/dist/cjs/client/utils/passkey/registerPasskey.js.map +1 -0
- package/dist/cjs/client/utils/passkey/registerPasskey.native.js +12 -0
- package/dist/cjs/client/utils/passkey/registerPasskey.native.js.map +1 -0
- package/dist/cjs/client/utils/passkey/serde.js +106 -0
- package/dist/cjs/client/utils/passkey/serde.js.map +1 -0
- package/dist/cjs/client/utils/passkey/types/index.js +25 -0
- package/dist/cjs/client/utils/passkey/types/index.js.map +1 -0
- package/dist/cjs/client/utils/passkey/types/shared.js +18 -0
- package/dist/cjs/client/utils/passkey/types/shared.js.map +1 -0
- package/dist/cjs/client/utils/store/autoSignInStore.js +45 -0
- package/dist/cjs/client/utils/store/autoSignInStore.js.map +1 -0
- package/dist/cjs/client/utils/store/index.js +9 -0
- package/dist/cjs/client/utils/store/index.js.map +1 -0
- package/dist/cjs/client/utils/store/signInStore.js.map +1 -0
- package/dist/cjs/client/utils/store/types.js +6 -0
- package/dist/cjs/client/utils/store/types.js.map +1 -0
- package/dist/cjs/foundation/apis/deleteWebAuthnCredential.js +33 -0
- package/dist/cjs/foundation/apis/deleteWebAuthnCredential.js.map +1 -0
- package/dist/cjs/foundation/apis/index.js +11 -0
- package/dist/cjs/foundation/apis/index.js.map +1 -0
- package/dist/cjs/foundation/apis/listWebAuthnCredentials.js +46 -0
- package/dist/cjs/foundation/apis/listWebAuthnCredentials.js.map +1 -0
- package/dist/cjs/foundation/convert/base64url/convertArrayBufferToBase64Url.js +21 -0
- package/dist/cjs/foundation/convert/base64url/convertArrayBufferToBase64Url.js.map +1 -0
- package/dist/cjs/foundation/convert/base64url/convertBase64UrlToArrayBuffer.js +17 -0
- package/dist/cjs/foundation/convert/base64url/convertBase64UrlToArrayBuffer.js.map +1 -0
- package/dist/cjs/foundation/convert/base64url/index.js +11 -0
- package/dist/cjs/foundation/convert/base64url/index.js.map +1 -0
- package/dist/cjs/foundation/convert/index.js +10 -0
- package/dist/cjs/foundation/convert/index.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createCompleteWebAuthnRegistrationClient.js +16 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createCompleteWebAuthnRegistrationClient.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteWebAuthnCredentialClient.js +16 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteWebAuthnCredentialClient.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createListWebAuthnCredentialsClient.js +16 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createListWebAuthnCredentialsClient.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.js +33 -4
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.js.map +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createStartWebAuthnRegistrationClient.js +16 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createStartWebAuthnRegistrationClient.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/index.js +9 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/index.js.map +1 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.js +44 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/types/index.js +3 -2
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/types/index.js.map +1 -1
- package/dist/cjs/foundation/types/index.js +6 -0
- package/dist/cjs/foundation/types/index.js.map +1 -0
- package/dist/cjs/foundation/types/inputs.js +6 -0
- package/dist/cjs/foundation/types/inputs.js.map +1 -0
- package/dist/cjs/foundation/types/models.js +6 -0
- package/dist/cjs/foundation/types/models.js.map +1 -0
- package/dist/cjs/foundation/types/outputs.js +6 -0
- package/dist/cjs/foundation/types/outputs.js.map +1 -0
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/autoSignIn.js +6 -2
- package/dist/cjs/providers/cognito/apis/autoSignIn.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/confirmSignIn.js +4 -4
- package/dist/cjs/providers/cognito/apis/confirmSignIn.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/confirmSignUp.js +8 -5
- package/dist/cjs/providers/cognito/apis/confirmSignUp.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/signIn.js +9 -0
- package/dist/cjs/providers/cognito/apis/signIn.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/signInWithCustomAuth.js +4 -4
- package/dist/cjs/providers/cognito/apis/signInWithCustomAuth.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/signInWithCustomSRPAuth.js +4 -4
- package/dist/cjs/providers/cognito/apis/signInWithCustomSRPAuth.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/signInWithSRP.js +7 -4
- package/dist/cjs/providers/cognito/apis/signInWithSRP.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/signInWithUserAuth.js +102 -0
- package/dist/cjs/providers/cognito/apis/signInWithUserAuth.js.map +1 -0
- package/dist/cjs/providers/cognito/apis/signInWithUserPassword.js +7 -4
- package/dist/cjs/providers/cognito/apis/signInWithUserPassword.js.map +1 -1
- package/dist/cjs/providers/cognito/apis/signUp.js +56 -49
- package/dist/cjs/providers/cognito/apis/signUp.js.map +1 -1
- package/dist/cjs/providers/cognito/utils/signInHelpers.js +60 -42
- package/dist/cjs/providers/cognito/utils/signInHelpers.js.map +1 -1
- package/dist/cjs/providers/cognito/utils/signUpHelpers.js +5 -31
- package/dist/cjs/providers/cognito/utils/signUpHelpers.js.map +1 -1
- package/dist/esm/client/apis/associateWebAuthnCredential.d.ts +14 -0
- package/dist/esm/client/apis/associateWebAuthnCredential.mjs +69 -0
- package/dist/esm/client/apis/associateWebAuthnCredential.mjs.map +1 -0
- package/dist/esm/client/apis/deleteWebAuthnCredential.d.ts +11 -0
- package/dist/esm/client/apis/deleteWebAuthnCredential.mjs +29 -0
- package/dist/esm/client/apis/deleteWebAuthnCredential.mjs.map +1 -0
- package/dist/esm/client/apis/index.d.ts +3 -0
- package/dist/esm/client/apis/index.mjs +4 -0
- package/dist/esm/client/apis/index.mjs.map +1 -0
- package/dist/esm/client/apis/listWebAuthnCredentials.d.ts +12 -0
- package/dist/esm/client/apis/listWebAuthnCredentials.mjs +30 -0
- package/dist/esm/client/apis/listWebAuthnCredentials.mjs.map +1 -0
- package/dist/esm/client/flows/shared/handlePasswordSRP.d.ts +31 -0
- package/dist/esm/client/flows/shared/handlePasswordSRP.mjs +86 -0
- package/dist/esm/client/flows/shared/handlePasswordSRP.mjs.map +1 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallenge.d.ts +23 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallenge.mjs +51 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallenge.mjs.map +1 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallengeWithPassword.d.ts +16 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallengeWithPassword.mjs +64 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallengeWithPassword.mjs.map +1 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.d.ts +18 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.mjs +81 -0
- package/dist/esm/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.mjs.map +1 -0
- package/dist/esm/client/flows/userAuth/handleUserAuthFlow.d.ts +27 -0
- package/dist/esm/client/flows/userAuth/handleUserAuthFlow.mjs +88 -0
- package/dist/esm/client/flows/userAuth/handleUserAuthFlow.mjs.map +1 -0
- package/dist/esm/client/flows/userAuth/handleWebAuthnSignInResult.d.ts +3 -0
- package/dist/esm/client/flows/userAuth/handleWebAuthnSignInResult.mjs +93 -0
- package/dist/esm/client/flows/userAuth/handleWebAuthnSignInResult.mjs.map +1 -0
- package/dist/esm/client/utils/index.d.ts +1 -0
- package/dist/esm/client/utils/index.mjs +4 -0
- package/dist/esm/client/utils/index.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/errors.d.ts +33 -0
- package/dist/esm/client/utils/passkey/errors.mjs +176 -0
- package/dist/esm/client/utils/passkey/errors.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/getIsPasskeySupported.d.ts +6 -0
- package/dist/esm/client/utils/passkey/getIsPasskeySupported.mjs +18 -0
- package/dist/esm/client/utils/passkey/getIsPasskeySupported.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/getIsPasskeySupported.native.d.ts +1 -0
- package/dist/esm/client/utils/passkey/getIsPasskeySupported.native.mjs +10 -0
- package/dist/esm/client/utils/passkey/getIsPasskeySupported.native.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/getPasskey.d.ts +2 -0
- package/dist/esm/client/utils/passkey/getPasskey.mjs +25 -0
- package/dist/esm/client/utils/passkey/getPasskey.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/getPasskey.native.d.ts +1 -0
- package/dist/esm/client/utils/passkey/getPasskey.native.mjs +10 -0
- package/dist/esm/client/utils/passkey/getPasskey.native.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/index.d.ts +2 -0
- package/dist/esm/client/utils/passkey/index.mjs +3 -0
- package/dist/esm/client/utils/passkey/index.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/registerPasskey.d.ts +7 -0
- package/dist/esm/client/utils/passkey/registerPasskey.mjs +30 -0
- package/dist/esm/client/utils/passkey/registerPasskey.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/registerPasskey.native.d.ts +1 -0
- package/dist/esm/client/utils/passkey/registerPasskey.native.mjs +10 -0
- package/dist/esm/client/utils/passkey/registerPasskey.native.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/serde.d.ts +25 -0
- package/dist/esm/client/utils/passkey/serde.mjs +102 -0
- package/dist/esm/client/utils/passkey/serde.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/types/index.d.ts +16 -0
- package/dist/esm/client/utils/passkey/types/index.mjs +18 -0
- package/dist/esm/client/utils/passkey/types/index.mjs.map +1 -0
- package/dist/esm/client/utils/passkey/types/shared.d.ts +106 -0
- package/dist/esm/client/utils/passkey/types/shared.mjs +16 -0
- package/dist/esm/client/utils/passkey/types/shared.mjs.map +1 -0
- package/dist/esm/client/utils/store/autoSignInStore.d.ts +21 -0
- package/dist/esm/client/utils/store/autoSignInStore.mjs +43 -0
- package/dist/esm/client/utils/store/autoSignInStore.mjs.map +1 -0
- package/dist/esm/client/utils/store/index.d.ts +2 -0
- package/dist/esm/client/utils/store/index.mjs +3 -0
- package/dist/esm/client/utils/store/index.mjs.map +1 -0
- package/dist/esm/{providers/cognito/utils → client/utils/store}/signInStore.d.ts +1 -1
- package/dist/esm/client/utils/store/signInStore.mjs.map +1 -0
- package/dist/esm/client/utils/store/types.d.ts +5 -0
- package/dist/esm/client/utils/store/types.mjs +2 -0
- package/dist/esm/client/utils/store/types.mjs.map +1 -0
- package/dist/esm/foundation/apis/deleteWebAuthnCredential.d.ts +3 -0
- package/dist/esm/foundation/apis/deleteWebAuthnCredential.mjs +38 -0
- package/dist/esm/foundation/apis/deleteWebAuthnCredential.mjs.map +1 -0
- package/dist/esm/foundation/apis/index.d.ts +2 -0
- package/dist/esm/foundation/apis/index.mjs +3 -0
- package/dist/esm/foundation/apis/index.mjs.map +1 -0
- package/dist/esm/foundation/apis/listWebAuthnCredentials.d.ts +3 -0
- package/dist/esm/foundation/apis/listWebAuthnCredentials.mjs +51 -0
- package/dist/esm/foundation/apis/listWebAuthnCredentials.mjs.map +1 -0
- package/dist/esm/foundation/convert/base64url/convertArrayBufferToBase64Url.d.ts +6 -0
- package/dist/esm/foundation/convert/base64url/convertArrayBufferToBase64Url.mjs +19 -0
- package/dist/esm/foundation/convert/base64url/convertArrayBufferToBase64Url.mjs.map +1 -0
- package/dist/esm/foundation/convert/base64url/convertBase64UrlToArrayBuffer.d.ts +6 -0
- package/dist/esm/foundation/convert/base64url/convertBase64UrlToArrayBuffer.mjs +15 -0
- package/dist/esm/foundation/convert/base64url/convertBase64UrlToArrayBuffer.mjs.map +1 -0
- package/dist/esm/foundation/convert/base64url/index.d.ts +2 -0
- package/dist/esm/foundation/convert/base64url/index.mjs +3 -0
- package/dist/esm/foundation/convert/base64url/index.mjs.map +1 -0
- package/dist/esm/foundation/convert/index.d.ts +1 -0
- package/dist/esm/foundation/convert/index.mjs +3 -0
- package/dist/esm/foundation/convert/index.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createCompleteWebAuthnRegistrationClient.d.ts +13 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createCompleteWebAuthnRegistrationClient.mjs +17 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createCompleteWebAuthnRegistrationClient.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteWebAuthnCredentialClient.d.ts +13 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteWebAuthnCredentialClient.mjs +17 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteWebAuthnCredentialClient.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createListWebAuthnCredentialsClient.d.ts +13 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createListWebAuthnCredentialsClient.mjs +17 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createListWebAuthnCredentialsClient.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.d.ts +3 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.mjs +32 -7
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.mjs.map +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createStartWebAuthnRegistrationClient.d.ts +13 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createStartWebAuthnRegistrationClient.mjs +17 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createStartWebAuthnRegistrationClient.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/index.d.ts +4 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/index.mjs +4 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/index.mjs.map +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.d.ts +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.d.ts +37 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.mjs +46 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/types/index.d.ts +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/types/index.mjs +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/types/sdk.d.ts +109 -5
- package/dist/esm/foundation/types/index.d.ts +3 -0
- package/dist/esm/foundation/types/index.mjs +2 -0
- package/dist/esm/foundation/types/index.mjs.map +1 -0
- package/dist/esm/foundation/types/inputs.d.ts +10 -0
- package/dist/esm/foundation/types/inputs.mjs +2 -0
- package/dist/esm/foundation/types/inputs.mjs.map +1 -0
- package/dist/esm/foundation/types/models.d.ts +11 -0
- package/dist/esm/foundation/types/models.mjs +2 -0
- package/dist/esm/foundation/types/models.mjs.map +1 -0
- package/dist/esm/foundation/types/outputs.d.ts +8 -0
- package/dist/esm/foundation/types/outputs.mjs +2 -0
- package/dist/esm/foundation/types/outputs.mjs.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.mjs +3 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/autoSignIn.d.ts +1 -1
- package/dist/esm/providers/cognito/apis/autoSignIn.mjs +7 -2
- package/dist/esm/providers/cognito/apis/autoSignIn.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/confirmResetPassword.mjs +2 -0
- package/dist/esm/providers/cognito/apis/confirmResetPassword.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/confirmSignIn.mjs +2 -1
- package/dist/esm/providers/cognito/apis/confirmSignIn.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/confirmSignUp.mjs +11 -5
- package/dist/esm/providers/cognito/apis/confirmSignUp.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/confirmUserAttribute.mjs +2 -0
- package/dist/esm/providers/cognito/apis/confirmUserAttribute.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/deleteUser.mjs +3 -0
- package/dist/esm/providers/cognito/apis/deleteUser.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/deleteUserAttributes.mjs +3 -0
- package/dist/esm/providers/cognito/apis/deleteUserAttributes.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/fetchDevices.mjs +3 -0
- package/dist/esm/providers/cognito/apis/fetchDevices.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/fetchMFAPreference.mjs +3 -0
- package/dist/esm/providers/cognito/apis/fetchMFAPreference.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/forgetDevice.mjs +3 -0
- package/dist/esm/providers/cognito/apis/forgetDevice.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/internal/fetchUserAttributes.mjs +3 -0
- package/dist/esm/providers/cognito/apis/internal/fetchUserAttributes.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/rememberDevice.mjs +3 -0
- package/dist/esm/providers/cognito/apis/rememberDevice.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/resendSignUpCode.mjs +2 -0
- package/dist/esm/providers/cognito/apis/resendSignUpCode.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/resetPassword.mjs +2 -0
- package/dist/esm/providers/cognito/apis/resetPassword.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/sendUserAttributeVerificationCode.mjs +3 -0
- package/dist/esm/providers/cognito/apis/sendUserAttributeVerificationCode.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/setUpTOTP.mjs +2 -0
- package/dist/esm/providers/cognito/apis/setUpTOTP.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/signIn.mjs +9 -0
- package/dist/esm/providers/cognito/apis/signIn.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/signInWithCustomAuth.mjs +2 -1
- package/dist/esm/providers/cognito/apis/signInWithCustomAuth.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/signInWithCustomSRPAuth.mjs +2 -1
- package/dist/esm/providers/cognito/apis/signInWithCustomSRPAuth.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/signInWithSRP.mjs +5 -1
- package/dist/esm/providers/cognito/apis/signInWithSRP.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/signInWithUserAuth.d.ts +13 -0
- package/dist/esm/providers/cognito/apis/signInWithUserAuth.mjs +104 -0
- package/dist/esm/providers/cognito/apis/signInWithUserAuth.mjs.map +1 -0
- package/dist/esm/providers/cognito/apis/signInWithUserPassword.mjs +6 -2
- package/dist/esm/providers/cognito/apis/signInWithUserPassword.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/signOut.mjs +2 -0
- package/dist/esm/providers/cognito/apis/signOut.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/signUp.mjs +58 -50
- package/dist/esm/providers/cognito/apis/signUp.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/updateMFAPreference.mjs +3 -0
- package/dist/esm/providers/cognito/apis/updateMFAPreference.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/updatePassword.mjs +2 -0
- package/dist/esm/providers/cognito/apis/updatePassword.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/updateUserAttributes.mjs +3 -0
- package/dist/esm/providers/cognito/apis/updateUserAttributes.mjs.map +1 -1
- package/dist/esm/providers/cognito/apis/verifyTOTPSetup.mjs +2 -0
- package/dist/esm/providers/cognito/apis/verifyTOTPSetup.mjs.map +1 -1
- package/dist/esm/providers/cognito/types/index.d.ts +2 -2
- package/dist/esm/providers/cognito/types/inputs.d.ts +4 -0
- package/dist/esm/providers/cognito/types/models.d.ts +7 -1
- package/dist/esm/providers/cognito/types/options.d.ts +2 -1
- package/dist/esm/providers/cognito/types/outputs.d.ts +4 -0
- package/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs +3 -0
- package/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs.map +1 -1
- package/dist/esm/providers/cognito/utils/signInHelpers.d.ts +2 -1
- package/dist/esm/providers/cognito/utils/signInHelpers.mjs +56 -37
- package/dist/esm/providers/cognito/utils/signInHelpers.mjs.map +1 -1
- package/dist/esm/providers/cognito/utils/signUpHelpers.d.ts +0 -6
- package/dist/esm/providers/cognito/utils/signUpHelpers.mjs +5 -26
- package/dist/esm/providers/cognito/utils/signUpHelpers.mjs.map +1 -1
- package/dist/esm/types/inputs.d.ts +2 -2
- package/dist/esm/types/models.d.ts +9 -1
- package/package.json +104 -104
- package/src/client/apis/associateWebAuthnCredential.ts +94 -0
- package/src/client/apis/deleteWebAuthnCredential.ts +24 -0
- package/src/client/apis/index.ts +6 -0
- package/src/client/apis/listWebAuthnCredentials.ts +28 -0
- package/src/client/flows/shared/handlePasswordSRP.ts +123 -0
- package/src/client/flows/userAuth/handleSelectChallenge.ts +62 -0
- package/src/client/flows/userAuth/handleSelectChallengeWithPassword.ts +74 -0
- package/src/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.ts +105 -0
- package/src/client/flows/userAuth/handleUserAuthFlow.ts +125 -0
- package/src/client/flows/userAuth/handleWebAuthnSignInResult.ts +130 -0
- package/src/client/utils/index.ts +4 -0
- package/src/client/utils/passkey/errors.ts +214 -0
- package/src/client/utils/passkey/getIsPasskeySupported.native.ts +8 -0
- package/src/client/utils/passkey/getIsPasskeySupported.ts +18 -0
- package/src/client/utils/passkey/getPasskey.native.ts +8 -0
- package/src/client/utils/passkey/getPasskey.ts +40 -0
- package/src/client/utils/passkey/index.ts +5 -0
- package/src/client/utils/passkey/registerPasskey.native.ts +8 -0
- package/src/client/utils/passkey/registerPasskey.ts +48 -0
- package/src/client/utils/passkey/serde.ts +151 -0
- package/src/client/utils/passkey/types/index.ts +61 -0
- package/src/client/utils/passkey/types/shared.ts +131 -0
- package/src/client/utils/store/autoSignInStore.ts +64 -0
- package/src/client/utils/store/index.ts +5 -0
- package/src/{providers/cognito/utils → client/utils/store}/signInStore.ts +3 -8
- package/src/client/utils/store/types.ts +9 -0
- package/src/foundation/apis/deleteWebAuthnCredential.ts +45 -0
- package/src/foundation/apis/index.ts +5 -0
- package/src/foundation/apis/listWebAuthnCredentials.ts +68 -0
- package/src/foundation/convert/base64url/convertArrayBufferToBase64Url.ts +18 -0
- package/src/foundation/convert/base64url/convertBase64UrlToArrayBuffer.ts +18 -0
- package/src/foundation/convert/base64url/index.ts +5 -0
- package/src/foundation/convert/index.ts +7 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/createCompleteWebAuthnRegistrationClient.ts +31 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteWebAuthnCredentialClient.ts +31 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/createListWebAuthnCredentialsClient.ts +31 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.ts +44 -7
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/createStartWebAuthnRegistrationClient.ts +31 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/index.ts +4 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.ts +5 -1
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.ts +43 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/types/index.ts +2 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/types/sdk.ts +141 -5
- package/src/foundation/types/index.ts +9 -0
- package/src/foundation/types/inputs.ts +14 -0
- package/src/foundation/types/models.ts +14 -0
- package/src/foundation/types/outputs.ts +12 -0
- package/src/index.ts +14 -0
- package/src/providers/cognito/apis/autoSignIn.ts +6 -2
- package/src/providers/cognito/apis/confirmSignIn.ts +1 -1
- package/src/providers/cognito/apis/confirmSignUp.ts +10 -9
- package/src/providers/cognito/apis/signIn.ts +10 -0
- package/src/providers/cognito/apis/signInWithCustomAuth.ts +1 -1
- package/src/providers/cognito/apis/signInWithCustomSRPAuth.ts +1 -1
- package/src/providers/cognito/apis/signInWithSRP.ts +6 -1
- package/src/providers/cognito/apis/signInWithUserAuth.ts +141 -0
- package/src/providers/cognito/apis/signInWithUserPassword.ts +7 -2
- package/src/providers/cognito/apis/signUp.ts +81 -72
- package/src/providers/cognito/types/index.ts +2 -0
- package/src/providers/cognito/types/inputs.ts +5 -0
- package/src/providers/cognito/types/models.ts +13 -0
- package/src/providers/cognito/types/options.ts +7 -1
- package/src/providers/cognito/types/outputs.ts +5 -0
- package/src/providers/cognito/utils/signInHelpers.ts +77 -55
- package/src/providers/cognito/utils/signUpHelpers.ts +6 -31
- package/src/types/inputs.ts +2 -2
- package/src/types/models.ts +13 -0
- package/dist/cjs/providers/cognito/utils/signInStore.js.map +0 -1
- package/dist/esm/providers/cognito/utils/signInStore.mjs.map +0 -1
- /package/dist/cjs/{providers/cognito/utils → client/utils/store}/signInStore.js +0 -0
- /package/dist/esm/{providers/cognito/utils → client/utils/store}/signInStore.mjs +0 -0
|
@@ -7,16 +7,21 @@ import { MetadataBearer as __MetadataBearer } from '@aws-sdk/types';
|
|
|
7
7
|
|
|
8
8
|
export type ChallengeName =
|
|
9
9
|
| 'SMS_MFA'
|
|
10
|
+
| 'SMS_OTP'
|
|
10
11
|
| 'SOFTWARE_TOKEN_MFA'
|
|
11
12
|
| 'EMAIL_OTP'
|
|
12
13
|
| 'SELECT_MFA_TYPE'
|
|
14
|
+
| 'SELECT_CHALLENGE'
|
|
13
15
|
| 'MFA_SETUP'
|
|
16
|
+
| 'PASSWORD'
|
|
17
|
+
| 'PASSWORD_SRP'
|
|
14
18
|
| 'PASSWORD_VERIFIER'
|
|
15
19
|
| 'CUSTOM_CHALLENGE'
|
|
16
20
|
| 'DEVICE_SRP_AUTH'
|
|
17
21
|
| 'DEVICE_PASSWORD_VERIFIER'
|
|
18
22
|
| 'ADMIN_NO_SRP_AUTH'
|
|
19
|
-
| 'NEW_PASSWORD_REQUIRED'
|
|
23
|
+
| 'NEW_PASSWORD_REQUIRED'
|
|
24
|
+
| 'WEB_AUTHN';
|
|
20
25
|
|
|
21
26
|
export type ChallengeParameters = {
|
|
22
27
|
CODE_DELIVERY_DESTINATION?: string;
|
|
@@ -27,6 +32,7 @@ export type ChallengeParameters = {
|
|
|
27
32
|
PASSWORD_CLAIM_SIGNATURE?: string;
|
|
28
33
|
MFAS_CAN_CHOOSE?: string;
|
|
29
34
|
MFAS_CAN_SETUP?: string;
|
|
35
|
+
CREDENTIAL_REQUEST_OPTIONS?: string;
|
|
30
36
|
} & Record<string, unknown>;
|
|
31
37
|
|
|
32
38
|
export type CognitoMFAType = 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA' | 'EMAIL_OTP';
|
|
@@ -56,6 +62,10 @@ declare enum ChallengeNameType {
|
|
|
56
62
|
SELECT_MFA_TYPE = 'SELECT_MFA_TYPE',
|
|
57
63
|
SMS_MFA = 'SMS_MFA',
|
|
58
64
|
SOFTWARE_TOKEN_MFA = 'SOFTWARE_TOKEN_MFA',
|
|
65
|
+
PASSWORD = 'PASSWORD',
|
|
66
|
+
PASSWORD_SRP = 'PASSWORD_SRP',
|
|
67
|
+
WEB_AUTHN = 'WEB_AUTHN',
|
|
68
|
+
SMS_OTP = 'SMS_OTP',
|
|
59
69
|
EMAIL_OTP = 'EMAIL_OTP',
|
|
60
70
|
}
|
|
61
71
|
declare enum DeliveryMediumType {
|
|
@@ -696,7 +706,15 @@ export interface ConfirmSignUpRequest {
|
|
|
696
706
|
/**
|
|
697
707
|
* <p>Represents the response from the server for the registration confirmation.</p>
|
|
698
708
|
*/
|
|
699
|
-
export
|
|
709
|
+
export interface ConfirmSignUpResponse {
|
|
710
|
+
/**
|
|
711
|
+
* <p>Your <code>ConfirmSignUp</code> request might produce a challenge that your user must
|
|
712
|
+
* respond to, for example a one-time code. The <code>Session</code> parameter tracks the
|
|
713
|
+
* session in the flow of challenge responses and requests. Include this parameter in
|
|
714
|
+
* <code>RespondToAuthChallenge</code> API requests.</p>
|
|
715
|
+
*/
|
|
716
|
+
Session?: string;
|
|
717
|
+
}
|
|
700
718
|
export type DeleteUserCommandInput = DeleteUserRequest;
|
|
701
719
|
export interface DeleteUserCommandOutput
|
|
702
720
|
extends DeleteUserResponse,
|
|
@@ -1083,6 +1101,13 @@ export interface InitiateAuthRequest {
|
|
|
1083
1101
|
* <p>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.</p>
|
|
1084
1102
|
*/
|
|
1085
1103
|
UserContextData?: UserContextDataType;
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* <p>The optional session ID from a <code>ConfirmSignUp</code> API
|
|
1107
|
+
* request. You can sign in a user directly from the sign-up process with the
|
|
1108
|
+
* <code>USER_AUTH</code> authentication flow.</p>
|
|
1109
|
+
*/
|
|
1110
|
+
Session?: string;
|
|
1086
1111
|
}
|
|
1087
1112
|
/**
|
|
1088
1113
|
* <p>Initiates the authentication response.</p>
|
|
@@ -1133,8 +1158,10 @@ export interface InitiateAuthResponse {
|
|
|
1133
1158
|
*/
|
|
1134
1159
|
ChallengeName?: ChallengeNameType | string;
|
|
1135
1160
|
/**
|
|
1136
|
-
* <p>The session that should pass both ways in challenge-response calls to the service. If
|
|
1137
|
-
*
|
|
1161
|
+
* <p>The session that should pass both ways in challenge-response calls to the service. If
|
|
1162
|
+
* the caller must pass another challenge, they return a session with other challenge
|
|
1163
|
+
* parameters. Include this session identifier in a <code>RespondToAuthChallenge</code> API
|
|
1164
|
+
* request.</p>
|
|
1138
1165
|
*/
|
|
1139
1166
|
Session?: string;
|
|
1140
1167
|
/**
|
|
@@ -1145,9 +1172,15 @@ export interface InitiateAuthResponse {
|
|
|
1145
1172
|
ChallengeParameters?: Record<string, string>;
|
|
1146
1173
|
/**
|
|
1147
1174
|
* <p>The result of the authentication response. This result is only returned if the caller doesn't need to pass another challenge. If the caller does need to pass another challenge before it gets
|
|
1148
|
-
* tokens, <code>ChallengeName</code>, <code>ChallengeParameters</code>, and <code>Session</code> are returned.</p>
|
|
1175
|
+
* tokens, <code>ChallengeName</code>, <code>ChallengeParameters</code>, <code>AvailableChallenges</code>, and <code>Session</code> are returned.</p>
|
|
1149
1176
|
*/
|
|
1150
1177
|
AuthenticationResult?: AuthenticationResultType;
|
|
1178
|
+
/**
|
|
1179
|
+
* <p>This response parameter prompts a user to select from multiple available challenges
|
|
1180
|
+
* that they can complete authentication with. For example, they might be able to continue
|
|
1181
|
+
* with passwordless authentication or with a one-time password from an SMS message.</p>
|
|
1182
|
+
*/
|
|
1183
|
+
AvailableChallenges?: ChallengeNameType[];
|
|
1151
1184
|
}
|
|
1152
1185
|
export type ListDevicesCommandInput = ListDevicesRequest;
|
|
1153
1186
|
export interface ListDevicesCommandOutput
|
|
@@ -1527,6 +1560,13 @@ export interface SignUpResponse {
|
|
|
1527
1560
|
* <p>The UUID of the authenticated user. This isn't the same as <code>username</code>.</p>
|
|
1528
1561
|
*/
|
|
1529
1562
|
UserSub: string | undefined;
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* <p>A session Id that you can pass to <code>ConfirmSignUp</code> when you want to
|
|
1566
|
+
* immediately sign in your user with the <code>USER_AUTH</code> flow after they complete
|
|
1567
|
+
* sign-up.</p>
|
|
1568
|
+
*/
|
|
1569
|
+
Session?: string;
|
|
1530
1570
|
}
|
|
1531
1571
|
/**
|
|
1532
1572
|
* <p>The type used for enabling software token MFA at the user level. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts, unless device tracking
|
|
@@ -1732,3 +1772,99 @@ export interface DeleteUserAttributesRequest {
|
|
|
1732
1772
|
*/
|
|
1733
1773
|
export type DeleteUserAttributesResponse = Record<never, never>;
|
|
1734
1774
|
export {};
|
|
1775
|
+
|
|
1776
|
+
export interface StartWebAuthnRegistrationRequest {
|
|
1777
|
+
/**
|
|
1778
|
+
* A valid access token that Amazon Cognito issued to the user whose passkey metadata you want to
|
|
1779
|
+
* generate.
|
|
1780
|
+
*/
|
|
1781
|
+
AccessToken: string | undefined;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
export interface StartWebAuthnRegistrationResponse {
|
|
1785
|
+
/**
|
|
1786
|
+
* The information that a user can provide in their request to register with their
|
|
1787
|
+
* passkey provider.
|
|
1788
|
+
*/
|
|
1789
|
+
CredentialCreationOptions: Record<never, never> | undefined;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
export type StartWebAuthnRegistrationCommandInput =
|
|
1793
|
+
StartWebAuthnRegistrationRequest;
|
|
1794
|
+
|
|
1795
|
+
export interface StartWebAuthnRegistrationCommandOutput
|
|
1796
|
+
extends StartWebAuthnRegistrationResponse,
|
|
1797
|
+
__MetadataBearer {}
|
|
1798
|
+
|
|
1799
|
+
export interface CompleteWebAuthnRegistrationRequest {
|
|
1800
|
+
/**
|
|
1801
|
+
* A valid access token that Amazon Cognito issued to the user whose passkey registration you want
|
|
1802
|
+
* to verify. This information informs your user pool of the details of the user's
|
|
1803
|
+
* successful registration with their passkey provider.
|
|
1804
|
+
*/
|
|
1805
|
+
AccessToken: string | undefined;
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* A <a href="https://www.w3.org/TR/webauthn-3/#dictdef-registrationresponsejson">RegistrationResponseJSON</a> public-key credential response from the
|
|
1809
|
+
* user's passkey provider.
|
|
1810
|
+
*/
|
|
1811
|
+
Credential: Record<never, never> | undefined;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
export type CompleteWebAuthnRegistrationResponse = Record<never, never>;
|
|
1815
|
+
|
|
1816
|
+
export type CompleteWebAuthnRegistrationCommandInput =
|
|
1817
|
+
CompleteWebAuthnRegistrationRequest;
|
|
1818
|
+
|
|
1819
|
+
export interface CompleteWebAuthnRegistrationCommandOutput
|
|
1820
|
+
extends CompleteWebAuthnRegistrationResponse,
|
|
1821
|
+
__MetadataBearer {}
|
|
1822
|
+
|
|
1823
|
+
/**
|
|
1824
|
+
* <p>The request to list WebAuthN credentials.</p>
|
|
1825
|
+
*/
|
|
1826
|
+
export interface ListWebAuthnCredentialsInput {
|
|
1827
|
+
AccessToken: string | undefined;
|
|
1828
|
+
NextToken?: string;
|
|
1829
|
+
MaxResults?: number;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
export interface WebAuthnCredentialDescription {
|
|
1833
|
+
CredentialId: string | undefined;
|
|
1834
|
+
FriendlyCredentialName: string | undefined;
|
|
1835
|
+
RelyingPartyId: string | undefined;
|
|
1836
|
+
AuthenticatorAttachment?: string;
|
|
1837
|
+
AuthenticatorTransports: string[] | undefined;
|
|
1838
|
+
CreatedAt: number | undefined;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
/**
|
|
1842
|
+
* <p>The response containing the list of WebAuthN credentials.</p>
|
|
1843
|
+
*/
|
|
1844
|
+
export interface ListWebAuthnCredentialsOutput {
|
|
1845
|
+
Credentials: WebAuthnCredentialDescription[] | undefined;
|
|
1846
|
+
NextToken?: string;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
export type ListWebAuthnCredentialsCommandInput = ListWebAuthnCredentialsInput;
|
|
1850
|
+
|
|
1851
|
+
export interface ListWebAuthnCredentialsCommandOutput
|
|
1852
|
+
extends ListWebAuthnCredentialsOutput,
|
|
1853
|
+
__MetadataBearer {}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* The request to delete a WebAuthN credential.
|
|
1857
|
+
*/
|
|
1858
|
+
export interface DeleteWebAuthnCredentialInput {
|
|
1859
|
+
AccessToken: string | undefined;
|
|
1860
|
+
CredentialId: string | undefined;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
export type DeleteWebAuthnCredentialOutput = Record<never, never>;
|
|
1864
|
+
|
|
1865
|
+
export type DeleteWebAuthnCredentialCommandInput =
|
|
1866
|
+
DeleteWebAuthnCredentialInput;
|
|
1867
|
+
|
|
1868
|
+
export interface DeleteWebAuthnCredentialCommandOutput
|
|
1869
|
+
extends DeleteWebAuthnCredentialOutput,
|
|
1870
|
+
__MetadataBearer {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
ListWebAuthnCredentialsInput,
|
|
6
|
+
DeleteWebAuthnCredentialInput,
|
|
7
|
+
} from './inputs';
|
|
8
|
+
export { ListWebAuthnCredentialsOutput } from './outputs';
|
|
9
|
+
export { AuthWebAuthnCredential } from './models';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Input type for Cognito listWebAuthnCredentials API.
|
|
6
|
+
*/
|
|
7
|
+
export interface ListWebAuthnCredentialsInput {
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
nextToken?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface DeleteWebAuthnCredentialInput {
|
|
13
|
+
credentialId: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shape of a WebAuthn credential
|
|
6
|
+
*/
|
|
7
|
+
export interface AuthWebAuthnCredential {
|
|
8
|
+
credentialId: string | undefined;
|
|
9
|
+
friendlyCredentialName: string | undefined;
|
|
10
|
+
relyingPartyId: string | undefined;
|
|
11
|
+
authenticatorAttachment?: string;
|
|
12
|
+
authenticatorTransports: string[] | undefined;
|
|
13
|
+
createdAt: Date | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { AuthWebAuthnCredential } from './models';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Output type for Cognito listWebAuthnCredentials API.
|
|
8
|
+
*/
|
|
9
|
+
export interface ListWebAuthnCredentialsOutput {
|
|
10
|
+
credentials: AuthWebAuthnCredential[];
|
|
11
|
+
nextToken?: string;
|
|
12
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -87,3 +87,17 @@ export {
|
|
|
87
87
|
AuthTokens,
|
|
88
88
|
JWT,
|
|
89
89
|
} from '@aws-amplify/core';
|
|
90
|
+
|
|
91
|
+
export { associateWebAuthnCredential } from './client/apis';
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
listWebAuthnCredentials,
|
|
95
|
+
deleteWebAuthnCredential,
|
|
96
|
+
} from './client/apis';
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
AuthWebAuthnCredential,
|
|
100
|
+
DeleteWebAuthnCredentialInput,
|
|
101
|
+
ListWebAuthnCredentialsInput,
|
|
102
|
+
ListWebAuthnCredentialsOutput,
|
|
103
|
+
} from './foundation/types';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
+
import { autoSignInStore } from '../../../client/utils/store';
|
|
4
5
|
import { AuthError } from '../../../errors/AuthError';
|
|
5
6
|
import { AUTO_SIGN_IN_EXCEPTION } from '../../../errors/constants';
|
|
6
7
|
import { AutoSignInCallback } from '../../../types/models';
|
|
@@ -114,6 +115,9 @@ export function setAutoSignIn(callback: AutoSignInCallback) {
|
|
|
114
115
|
*
|
|
115
116
|
* @internal
|
|
116
117
|
*/
|
|
117
|
-
export function resetAutoSignIn() {
|
|
118
|
-
|
|
118
|
+
export function resetAutoSignIn(resetCallback = true) {
|
|
119
|
+
if (resetCallback) {
|
|
120
|
+
autoSignIn = initialAutoSignIn;
|
|
121
|
+
}
|
|
122
|
+
autoSignInStore.dispatch({ type: 'RESET' });
|
|
119
123
|
}
|
|
@@ -14,15 +14,13 @@ import { AuthValidationErrorCode } from '../../../errors/types/validation';
|
|
|
14
14
|
import { ConfirmSignUpException } from '../types/errors';
|
|
15
15
|
import { getRegionFromUserPoolId } from '../../../foundation/parsers';
|
|
16
16
|
import { AutoSignInEventData } from '../types/models';
|
|
17
|
-
import {
|
|
18
|
-
isAutoSignInStarted,
|
|
19
|
-
isAutoSignInUserUsingConfirmSignUp,
|
|
20
|
-
setAutoSignInStarted,
|
|
21
|
-
} from '../utils/signUpHelpers';
|
|
22
17
|
import { getAuthUserAgentValue } from '../../../utils';
|
|
23
18
|
import { getUserContextData } from '../utils/userContextData';
|
|
24
19
|
import { createConfirmSignUpClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider';
|
|
25
20
|
import { createCognitoUserPoolEndpointResolver } from '../factories';
|
|
21
|
+
import { autoSignInStore } from '../../../client/utils/store';
|
|
22
|
+
|
|
23
|
+
import { resetAutoSignIn } from './autoSignIn';
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
26
|
* Confirms a new user account.
|
|
@@ -65,7 +63,7 @@ export async function confirmSignUp(
|
|
|
65
63
|
}),
|
|
66
64
|
});
|
|
67
65
|
|
|
68
|
-
await confirmSignUpClient(
|
|
66
|
+
const { Session: session } = await confirmSignUpClient(
|
|
69
67
|
{
|
|
70
68
|
region: getRegionFromUserPoolId(authConfig.userPoolId),
|
|
71
69
|
userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignUp),
|
|
@@ -88,16 +86,20 @@ export async function confirmSignUp(
|
|
|
88
86
|
signUpStep: 'DONE',
|
|
89
87
|
},
|
|
90
88
|
};
|
|
89
|
+
const autoSignInStoreState = autoSignInStore.getState();
|
|
91
90
|
|
|
92
91
|
if (
|
|
93
|
-
!
|
|
94
|
-
|
|
92
|
+
!autoSignInStoreState.active ||
|
|
93
|
+
autoSignInStoreState.username !== username
|
|
95
94
|
) {
|
|
96
95
|
resolve(signUpOut);
|
|
96
|
+
resetAutoSignIn();
|
|
97
97
|
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
autoSignInStore.dispatch({ type: 'SET_SESSION', value: session });
|
|
102
|
+
|
|
101
103
|
const stopListener = HubInternal.listen<AutoSignInEventData>(
|
|
102
104
|
'auth-internal',
|
|
103
105
|
({ payload }) => {
|
|
@@ -109,7 +111,6 @@ export async function confirmSignUp(
|
|
|
109
111
|
signUpStep: 'COMPLETE_AUTO_SIGN_IN',
|
|
110
112
|
},
|
|
111
113
|
});
|
|
112
|
-
setAutoSignInStarted(false);
|
|
113
114
|
stopListener();
|
|
114
115
|
}
|
|
115
116
|
},
|
|
@@ -13,6 +13,8 @@ import { signInWithCustomAuth } from './signInWithCustomAuth';
|
|
|
13
13
|
import { signInWithCustomSRPAuth } from './signInWithCustomSRPAuth';
|
|
14
14
|
import { signInWithSRP } from './signInWithSRP';
|
|
15
15
|
import { signInWithUserPassword } from './signInWithUserPassword';
|
|
16
|
+
import { signInWithUserAuth } from './signInWithUserAuth';
|
|
17
|
+
import { resetAutoSignIn } from './autoSignIn';
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
* Signs a user in
|
|
@@ -26,6 +28,12 @@ import { signInWithUserPassword } from './signInWithUserPassword';
|
|
|
26
28
|
* @throws AuthTokenConfigException - Thrown when the token provider config is invalid.
|
|
27
29
|
*/
|
|
28
30
|
export async function signIn(input: SignInInput): Promise<SignInOutput> {
|
|
31
|
+
// Here we want to reset the store but not reassign the callback.
|
|
32
|
+
// The callback is reset when the underlying promise resolves or rejects.
|
|
33
|
+
// With the advent of session based sign in, this guarantees that the signIn API initiates a new auth flow,
|
|
34
|
+
// regardless of whether it is called for a user currently engaged in an active auto sign in session.
|
|
35
|
+
resetAutoSignIn(false);
|
|
36
|
+
|
|
29
37
|
const authFlowType = input.options?.authFlowType;
|
|
30
38
|
await assertUserNotAuthenticated();
|
|
31
39
|
switch (authFlowType) {
|
|
@@ -37,6 +45,8 @@ export async function signIn(input: SignInInput): Promise<SignInOutput> {
|
|
|
37
45
|
return signInWithCustomAuth(input);
|
|
38
46
|
case 'CUSTOM_WITH_SRP':
|
|
39
47
|
return signInWithCustomSRPAuth(input);
|
|
48
|
+
case 'USER_AUTH':
|
|
49
|
+
return signInWithUserAuth(input);
|
|
40
50
|
default:
|
|
41
51
|
return signInWithSRP(input);
|
|
42
52
|
}
|
|
@@ -30,11 +30,13 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
cleanActiveSignInState,
|
|
32
32
|
setActiveSignInState,
|
|
33
|
-
} from '
|
|
33
|
+
} from '../../../client/utils/store';
|
|
34
34
|
import { cacheCognitoTokens } from '../tokenProvider/cacheTokens';
|
|
35
35
|
import { tokenOrchestrator } from '../tokenProvider';
|
|
36
36
|
import { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent';
|
|
37
37
|
|
|
38
|
+
import { resetAutoSignIn } from './autoSignIn';
|
|
39
|
+
|
|
38
40
|
/**
|
|
39
41
|
* Signs a user in
|
|
40
42
|
*
|
|
@@ -104,6 +106,8 @@ export async function signInWithSRP(
|
|
|
104
106
|
|
|
105
107
|
await dispatchSignedInHubEvent();
|
|
106
108
|
|
|
109
|
+
resetAutoSignIn();
|
|
110
|
+
|
|
107
111
|
return {
|
|
108
112
|
isSignedIn: true,
|
|
109
113
|
nextStep: { signInStep: 'DONE' },
|
|
@@ -116,6 +120,7 @@ export async function signInWithSRP(
|
|
|
116
120
|
});
|
|
117
121
|
} catch (error) {
|
|
118
122
|
cleanActiveSignInState();
|
|
123
|
+
resetAutoSignIn();
|
|
119
124
|
assertServiceError(error);
|
|
120
125
|
const result = getSignInResultFromError(error.name);
|
|
121
126
|
if (result) return result;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { Amplify } from '@aws-amplify/core';
|
|
5
|
+
import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
|
|
7
|
+
import { AuthValidationErrorCode } from '../../../errors/types/validation';
|
|
8
|
+
import { assertValidationError } from '../../../errors/utils/assertValidationError';
|
|
9
|
+
import { assertServiceError } from '../../../errors/utils/assertServiceError';
|
|
10
|
+
import {
|
|
11
|
+
ChallengeName,
|
|
12
|
+
ChallengeParameters,
|
|
13
|
+
} from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/types';
|
|
14
|
+
import {
|
|
15
|
+
InitiateAuthException,
|
|
16
|
+
RespondToAuthChallengeException,
|
|
17
|
+
} from '../types/errors';
|
|
18
|
+
import {
|
|
19
|
+
getActiveSignInUsername,
|
|
20
|
+
getNewDeviceMetadata,
|
|
21
|
+
getSignInResult,
|
|
22
|
+
getSignInResultFromError,
|
|
23
|
+
} from '../utils/signInHelpers';
|
|
24
|
+
import {
|
|
25
|
+
CognitoAuthSignInDetails,
|
|
26
|
+
SignInWithUserAuthInput,
|
|
27
|
+
SignInWithUserAuthOutput,
|
|
28
|
+
} from '../types';
|
|
29
|
+
import {
|
|
30
|
+
autoSignInStore,
|
|
31
|
+
cleanActiveSignInState,
|
|
32
|
+
setActiveSignInState,
|
|
33
|
+
} from '../../../client/utils/store';
|
|
34
|
+
import { cacheCognitoTokens } from '../tokenProvider/cacheTokens';
|
|
35
|
+
import { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent';
|
|
36
|
+
import { tokenOrchestrator } from '../tokenProvider';
|
|
37
|
+
import {
|
|
38
|
+
HandleUserAuthFlowInput,
|
|
39
|
+
handleUserAuthFlow,
|
|
40
|
+
} from '../../../client/flows/userAuth/handleUserAuthFlow';
|
|
41
|
+
|
|
42
|
+
import { resetAutoSignIn } from './autoSignIn';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Signs a user in through a registered email or phone number without a password by by receiving and entering an OTP.
|
|
46
|
+
*
|
|
47
|
+
* @param input - The SignInWithUserAuthInput object
|
|
48
|
+
* @returns SignInWithUserAuthOutput
|
|
49
|
+
* @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException } - Cognito service errors
|
|
50
|
+
* thrown during the sign-in process.
|
|
51
|
+
* @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown when either username or password -- needs to change
|
|
52
|
+
* are not defined.
|
|
53
|
+
* @throws AuthTokenConfigException - Thrown when the token provider config is invalid.
|
|
54
|
+
*/
|
|
55
|
+
export async function signInWithUserAuth(
|
|
56
|
+
input: SignInWithUserAuthInput,
|
|
57
|
+
): Promise<SignInWithUserAuthOutput> {
|
|
58
|
+
const { username, password, options } = input;
|
|
59
|
+
const authConfig = Amplify.getConfig().Auth?.Cognito;
|
|
60
|
+
const signInDetails: CognitoAuthSignInDetails = {
|
|
61
|
+
loginId: username,
|
|
62
|
+
authFlowType: 'USER_AUTH',
|
|
63
|
+
};
|
|
64
|
+
assertTokenProviderConfig(authConfig);
|
|
65
|
+
const clientMetaData = options?.clientMetadata;
|
|
66
|
+
const preferredChallenge = options?.preferredChallenge;
|
|
67
|
+
|
|
68
|
+
assertValidationError(
|
|
69
|
+
!!username,
|
|
70
|
+
AuthValidationErrorCode.EmptySignInUsername,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const handleUserAuthFlowInput: HandleUserAuthFlowInput = {
|
|
75
|
+
username,
|
|
76
|
+
config: authConfig,
|
|
77
|
+
tokenOrchestrator,
|
|
78
|
+
clientMetadata: clientMetaData,
|
|
79
|
+
preferredChallenge,
|
|
80
|
+
password,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const autoSignInStoreState = autoSignInStore.getState();
|
|
84
|
+
if (
|
|
85
|
+
autoSignInStoreState.active &&
|
|
86
|
+
autoSignInStoreState.username === username
|
|
87
|
+
) {
|
|
88
|
+
handleUserAuthFlowInput.session = autoSignInStoreState.session;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const response = await handleUserAuthFlow(handleUserAuthFlowInput);
|
|
92
|
+
|
|
93
|
+
const activeUsername = getActiveSignInUsername(username);
|
|
94
|
+
|
|
95
|
+
setActiveSignInState({
|
|
96
|
+
signInSession: response.Session,
|
|
97
|
+
username: activeUsername,
|
|
98
|
+
challengeName: response.ChallengeName as ChallengeName,
|
|
99
|
+
signInDetails,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
if (response.AuthenticationResult) {
|
|
103
|
+
cleanActiveSignInState();
|
|
104
|
+
await cacheCognitoTokens({
|
|
105
|
+
username: activeUsername,
|
|
106
|
+
...response.AuthenticationResult,
|
|
107
|
+
NewDeviceMetadata: await getNewDeviceMetadata({
|
|
108
|
+
userPoolId: authConfig.userPoolId,
|
|
109
|
+
userPoolEndpoint: authConfig.userPoolEndpoint,
|
|
110
|
+
newDeviceMetadata: response.AuthenticationResult.NewDeviceMetadata,
|
|
111
|
+
accessToken: response.AuthenticationResult.AccessToken,
|
|
112
|
+
}),
|
|
113
|
+
signInDetails,
|
|
114
|
+
});
|
|
115
|
+
await dispatchSignedInHubEvent();
|
|
116
|
+
|
|
117
|
+
resetAutoSignIn();
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
isSignedIn: true,
|
|
121
|
+
nextStep: { signInStep: 'DONE' },
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return getSignInResult({
|
|
126
|
+
challengeName: response.ChallengeName as ChallengeName,
|
|
127
|
+
challengeParameters: response.ChallengeParameters as ChallengeParameters,
|
|
128
|
+
availableChallenges:
|
|
129
|
+
'AvailableChallenges' in response
|
|
130
|
+
? (response.AvailableChallenges as ChallengeName[])
|
|
131
|
+
: undefined,
|
|
132
|
+
});
|
|
133
|
+
} catch (error) {
|
|
134
|
+
cleanActiveSignInState();
|
|
135
|
+
resetAutoSignIn();
|
|
136
|
+
assertServiceError(error);
|
|
137
|
+
const result = getSignInResultFromError(error.name);
|
|
138
|
+
if (result) return result;
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -28,11 +28,13 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
cleanActiveSignInState,
|
|
30
30
|
setActiveSignInState,
|
|
31
|
-
} from '
|
|
31
|
+
} from '../../../client/utils/store';
|
|
32
32
|
import { cacheCognitoTokens } from '../tokenProvider/cacheTokens';
|
|
33
33
|
import { tokenOrchestrator } from '../tokenProvider';
|
|
34
34
|
import { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent';
|
|
35
35
|
|
|
36
|
+
import { resetAutoSignIn } from './autoSignIn';
|
|
37
|
+
|
|
36
38
|
/**
|
|
37
39
|
* Signs a user in using USER_PASSWORD_AUTH AuthFlowType
|
|
38
40
|
*
|
|
@@ -84,6 +86,7 @@ export async function signInWithUserPassword(
|
|
|
84
86
|
signInDetails,
|
|
85
87
|
});
|
|
86
88
|
if (AuthenticationResult) {
|
|
89
|
+
cleanActiveSignInState();
|
|
87
90
|
await cacheCognitoTokens({
|
|
88
91
|
...AuthenticationResult,
|
|
89
92
|
username: activeUsername,
|
|
@@ -95,10 +98,11 @@ export async function signInWithUserPassword(
|
|
|
95
98
|
}),
|
|
96
99
|
signInDetails,
|
|
97
100
|
});
|
|
98
|
-
cleanActiveSignInState();
|
|
99
101
|
|
|
100
102
|
await dispatchSignedInHubEvent();
|
|
101
103
|
|
|
104
|
+
resetAutoSignIn();
|
|
105
|
+
|
|
102
106
|
return {
|
|
103
107
|
isSignedIn: true,
|
|
104
108
|
nextStep: { signInStep: 'DONE' },
|
|
@@ -111,6 +115,7 @@ export async function signInWithUserPassword(
|
|
|
111
115
|
});
|
|
112
116
|
} catch (error) {
|
|
113
117
|
cleanActiveSignInState();
|
|
118
|
+
resetAutoSignIn();
|
|
114
119
|
assertServiceError(error);
|
|
115
120
|
const result = getSignInResultFromError(error.name);
|
|
116
121
|
if (result) return result;
|