@aws-amplify/auth 6.13.3 → 6.13.4-unstable.16ac204.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/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.js +16 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.js.map +1 -0
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/index.js +3 -1
- package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/index.js.map +1 -1
- package/dist/cjs/providers/cognito/utils/refreshAuthTokens.js +6 -20
- package/dist/cjs/providers/cognito/utils/refreshAuthTokens.js.map +1 -1
- package/dist/esm/client/flows/shared/handlePasswordSRP.mjs +1 -1
- package/dist/esm/client/flows/userAuth/handleUserAuthFlow.mjs +1 -1
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.d.ts +13 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.mjs +17 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.mjs.map +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/index.d.ts +1 -0
- package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/index.mjs +1 -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/sdk.d.ts +90 -0
- package/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs +9 -23
- package/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs.map +1 -1
- package/dist/esm/providers/cognito/utils/signInHelpers.mjs +1 -1
- package/package.json +105 -105
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.ts +31 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/index.ts +1 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.ts +1 -0
- package/src/foundation/factories/serviceClients/cognitoIdentityProvider/types/sdk.ts +93 -0
- package/src/providers/cognito/utils/refreshAuthTokens.ts +6 -23
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createGetTokensFromRefreshTokenClient = void 0;
|
|
7
|
+
const composers_1 = require("@aws-amplify/core/internals/aws-client-utils/composers");
|
|
8
|
+
const serde_1 = require("./shared/serde");
|
|
9
|
+
const handler_1 = require("./shared/handler");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const createGetTokensFromRefreshTokenClient = (config) => (0, composers_1.composeServiceApi)(handler_1.cognitoUserPoolTransferHandler, (0, serde_1.createUserPoolSerializer)('GetTokensFromRefreshToken'), (0, serde_1.createUserPoolDeserializer)(), {
|
|
12
|
+
...constants_1.DEFAULT_SERVICE_CLIENT_API_CONFIG,
|
|
13
|
+
...config,
|
|
14
|
+
});
|
|
15
|
+
exports.createGetTokensFromRefreshTokenClient = createGetTokensFromRefreshTokenClient;
|
|
16
|
+
//# sourceMappingURL=createGetTokensFromRefreshTokenClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createGetTokensFromRefreshTokenClient.js","sources":["../../../../../../src/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createGetTokensFromRefreshTokenClient = void 0;\nconst composers_1 = require(\"@aws-amplify/core/internals/aws-client-utils/composers\");\nconst serde_1 = require(\"./shared/serde\");\nconst handler_1 = require(\"./shared/handler\");\nconst constants_1 = require(\"./constants\");\nconst createGetTokensFromRefreshTokenClient = (config) => (0, composers_1.composeServiceApi)(handler_1.cognitoUserPoolTransferHandler, (0, serde_1.createUserPoolSerializer)('GetTokensFromRefreshToken'), (0, serde_1.createUserPoolDeserializer)(), {\n ...constants_1.DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\nexports.createGetTokensFromRefreshTokenClient = createGetTokensFromRefreshTokenClient;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qCAAqC,GAAG,MAAM;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,wDAAwD,CAAC;AACrF,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,MAAM,qCAAqC,GAAG,CAAC,MAAM,KAAK,IAAI,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC,8BAA8B,EAAE,IAAI,OAAO,CAAC,wBAAwB,EAAE,2BAA2B,CAAC,EAAE,IAAI,OAAO,CAAC,0BAA0B,GAAG,EAAE;AACtP,IAAI,GAAG,WAAW,CAAC,iCAAiC;AACpD,IAAI,GAAG,MAAM;AACb,CAAC,CAAC;AACF,OAAO,CAAC,qCAAqC,GAAG,qCAAqC;;"}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createDeleteWebAuthnCredentialClient = exports.createListWebAuthnCredentialsClient = exports.createCompleteWebAuthnRegistrationClient = exports.createStartWebAuthnRegistrationClient = exports.createDeleteUserAttributesClient = exports.createListDevicesClient = exports.createUpdateDeviceStatusClient = exports.createVerifyUserAttributeClient = exports.createUpdateUserAttributesClient = exports.createGlobalSignOutClient = exports.createGetUserAttributeVerificationCodeClient = exports.createDeleteUserClient = exports.createForgetDeviceClient = exports.createConfirmDeviceClient = exports.createChangePasswordClient = exports.createGetUserClient = exports.createSetUserMFAPreferenceClient = exports.createAssociateSoftwareTokenClient = exports.createVerifySoftwareTokenClient = exports.createResendConfirmationCodeClient = exports.createRespondToAuthChallengeClient = exports.createConfirmForgotPasswordClient = exports.createForgotPasswordClient = exports.createConfirmSignUpClient = exports.createSignUpClient = exports.createRevokeTokenClient = exports.createInitiateAuthClient = void 0;
|
|
6
|
+
exports.createDeleteWebAuthnCredentialClient = exports.createListWebAuthnCredentialsClient = exports.createCompleteWebAuthnRegistrationClient = exports.createStartWebAuthnRegistrationClient = exports.createDeleteUserAttributesClient = exports.createListDevicesClient = exports.createUpdateDeviceStatusClient = exports.createVerifyUserAttributeClient = exports.createUpdateUserAttributesClient = exports.createGlobalSignOutClient = exports.createGetUserAttributeVerificationCodeClient = exports.createDeleteUserClient = exports.createForgetDeviceClient = exports.createConfirmDeviceClient = exports.createChangePasswordClient = exports.createGetUserClient = exports.createSetUserMFAPreferenceClient = exports.createAssociateSoftwareTokenClient = exports.createVerifySoftwareTokenClient = exports.createResendConfirmationCodeClient = exports.createRespondToAuthChallengeClient = exports.createConfirmForgotPasswordClient = exports.createForgotPasswordClient = exports.createConfirmSignUpClient = exports.createSignUpClient = exports.createRevokeTokenClient = exports.createGetTokensFromRefreshTokenClient = exports.createInitiateAuthClient = void 0;
|
|
7
7
|
var createInitiateAuthClient_1 = require("./createInitiateAuthClient");
|
|
8
8
|
Object.defineProperty(exports, "createInitiateAuthClient", { enumerable: true, get: function () { return createInitiateAuthClient_1.createInitiateAuthClient; } });
|
|
9
|
+
var createGetTokensFromRefreshTokenClient_1 = require("./createGetTokensFromRefreshTokenClient");
|
|
10
|
+
Object.defineProperty(exports, "createGetTokensFromRefreshTokenClient", { enumerable: true, get: function () { return createGetTokensFromRefreshTokenClient_1.createGetTokensFromRefreshTokenClient; } });
|
|
9
11
|
var createRevokeTokenClient_1 = require("./createRevokeTokenClient");
|
|
10
12
|
Object.defineProperty(exports, "createRevokeTokenClient", { enumerable: true, get: function () { return createRevokeTokenClient_1.createRevokeTokenClient; } });
|
|
11
13
|
var createSignUpClient_1 = require("./createSignUpClient");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/foundation/factories/serviceClients/cognitoIdentityProvider/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDeleteWebAuthnCredentialClient = exports.createListWebAuthnCredentialsClient = exports.createCompleteWebAuthnRegistrationClient = exports.createStartWebAuthnRegistrationClient = exports.createDeleteUserAttributesClient = exports.createListDevicesClient = exports.createUpdateDeviceStatusClient = exports.createVerifyUserAttributeClient = exports.createUpdateUserAttributesClient = exports.createGlobalSignOutClient = exports.createGetUserAttributeVerificationCodeClient = exports.createDeleteUserClient = exports.createForgetDeviceClient = exports.createConfirmDeviceClient = exports.createChangePasswordClient = exports.createGetUserClient = exports.createSetUserMFAPreferenceClient = exports.createAssociateSoftwareTokenClient = exports.createVerifySoftwareTokenClient = exports.createResendConfirmationCodeClient = exports.createRespondToAuthChallengeClient = exports.createConfirmForgotPasswordClient = exports.createForgotPasswordClient = exports.createConfirmSignUpClient = exports.createSignUpClient = exports.createRevokeTokenClient = exports.createInitiateAuthClient = void 0;\nvar createInitiateAuthClient_1 = require(\"./createInitiateAuthClient\");\nObject.defineProperty(exports, \"createInitiateAuthClient\", { enumerable: true, get: function () { return createInitiateAuthClient_1.createInitiateAuthClient; } });\nvar createRevokeTokenClient_1 = require(\"./createRevokeTokenClient\");\nObject.defineProperty(exports, \"createRevokeTokenClient\", { enumerable: true, get: function () { return createRevokeTokenClient_1.createRevokeTokenClient; } });\nvar createSignUpClient_1 = require(\"./createSignUpClient\");\nObject.defineProperty(exports, \"createSignUpClient\", { enumerable: true, get: function () { return createSignUpClient_1.createSignUpClient; } });\nvar createConfirmSignUpClient_1 = require(\"./createConfirmSignUpClient\");\nObject.defineProperty(exports, \"createConfirmSignUpClient\", { enumerable: true, get: function () { return createConfirmSignUpClient_1.createConfirmSignUpClient; } });\nvar createForgotPasswordClient_1 = require(\"./createForgotPasswordClient\");\nObject.defineProperty(exports, \"createForgotPasswordClient\", { enumerable: true, get: function () { return createForgotPasswordClient_1.createForgotPasswordClient; } });\nvar createConfirmForgotPasswordClient_1 = require(\"./createConfirmForgotPasswordClient\");\nObject.defineProperty(exports, \"createConfirmForgotPasswordClient\", { enumerable: true, get: function () { return createConfirmForgotPasswordClient_1.createConfirmForgotPasswordClient; } });\nvar createRespondToAuthChallengeClient_1 = require(\"./createRespondToAuthChallengeClient\");\nObject.defineProperty(exports, \"createRespondToAuthChallengeClient\", { enumerable: true, get: function () { return createRespondToAuthChallengeClient_1.createRespondToAuthChallengeClient; } });\nvar createResendConfirmationCodeClient_1 = require(\"./createResendConfirmationCodeClient\");\nObject.defineProperty(exports, \"createResendConfirmationCodeClient\", { enumerable: true, get: function () { return createResendConfirmationCodeClient_1.createResendConfirmationCodeClient; } });\nvar createVerifySoftwareTokenClient_1 = require(\"./createVerifySoftwareTokenClient\");\nObject.defineProperty(exports, \"createVerifySoftwareTokenClient\", { enumerable: true, get: function () { return createVerifySoftwareTokenClient_1.createVerifySoftwareTokenClient; } });\nvar createAssociateSoftwareTokenClient_1 = require(\"./createAssociateSoftwareTokenClient\");\nObject.defineProperty(exports, \"createAssociateSoftwareTokenClient\", { enumerable: true, get: function () { return createAssociateSoftwareTokenClient_1.createAssociateSoftwareTokenClient; } });\nvar createSetUserMFAPreferenceClient_1 = require(\"./createSetUserMFAPreferenceClient\");\nObject.defineProperty(exports, \"createSetUserMFAPreferenceClient\", { enumerable: true, get: function () { return createSetUserMFAPreferenceClient_1.createSetUserMFAPreferenceClient; } });\nvar createGetUserClient_1 = require(\"./createGetUserClient\");\nObject.defineProperty(exports, \"createGetUserClient\", { enumerable: true, get: function () { return createGetUserClient_1.createGetUserClient; } });\nvar createChangePasswordClient_1 = require(\"./createChangePasswordClient\");\nObject.defineProperty(exports, \"createChangePasswordClient\", { enumerable: true, get: function () { return createChangePasswordClient_1.createChangePasswordClient; } });\nvar createConfirmDeviceClient_1 = require(\"./createConfirmDeviceClient\");\nObject.defineProperty(exports, \"createConfirmDeviceClient\", { enumerable: true, get: function () { return createConfirmDeviceClient_1.createConfirmDeviceClient; } });\nvar createForgetDeviceClient_1 = require(\"./createForgetDeviceClient\");\nObject.defineProperty(exports, \"createForgetDeviceClient\", { enumerable: true, get: function () { return createForgetDeviceClient_1.createForgetDeviceClient; } });\nvar createDeleteUserClient_1 = require(\"./createDeleteUserClient\");\nObject.defineProperty(exports, \"createDeleteUserClient\", { enumerable: true, get: function () { return createDeleteUserClient_1.createDeleteUserClient; } });\nvar createGetUserAttributeVerificationCodeClient_1 = require(\"./createGetUserAttributeVerificationCodeClient\");\nObject.defineProperty(exports, \"createGetUserAttributeVerificationCodeClient\", { enumerable: true, get: function () { return createGetUserAttributeVerificationCodeClient_1.createGetUserAttributeVerificationCodeClient; } });\nvar createGlobalSignOutClient_1 = require(\"./createGlobalSignOutClient\");\nObject.defineProperty(exports, \"createGlobalSignOutClient\", { enumerable: true, get: function () { return createGlobalSignOutClient_1.createGlobalSignOutClient; } });\nvar createUpdateUserAttributesClient_1 = require(\"./createUpdateUserAttributesClient\");\nObject.defineProperty(exports, \"createUpdateUserAttributesClient\", { enumerable: true, get: function () { return createUpdateUserAttributesClient_1.createUpdateUserAttributesClient; } });\nvar createVerifyUserAttributeClient_1 = require(\"./createVerifyUserAttributeClient\");\nObject.defineProperty(exports, \"createVerifyUserAttributeClient\", { enumerable: true, get: function () { return createVerifyUserAttributeClient_1.createVerifyUserAttributeClient; } });\nvar createUpdateDeviceStatusClient_1 = require(\"./createUpdateDeviceStatusClient\");\nObject.defineProperty(exports, \"createUpdateDeviceStatusClient\", { enumerable: true, get: function () { return createUpdateDeviceStatusClient_1.createUpdateDeviceStatusClient; } });\nvar createListDevicesClient_1 = require(\"./createListDevicesClient\");\nObject.defineProperty(exports, \"createListDevicesClient\", { enumerable: true, get: function () { return createListDevicesClient_1.createListDevicesClient; } });\nvar createDeleteUserAttributesClient_1 = require(\"./createDeleteUserAttributesClient\");\nObject.defineProperty(exports, \"createDeleteUserAttributesClient\", { enumerable: true, get: function () { return createDeleteUserAttributesClient_1.createDeleteUserAttributesClient; } });\nvar createStartWebAuthnRegistrationClient_1 = require(\"./createStartWebAuthnRegistrationClient\");\nObject.defineProperty(exports, \"createStartWebAuthnRegistrationClient\", { enumerable: true, get: function () { return createStartWebAuthnRegistrationClient_1.createStartWebAuthnRegistrationClient; } });\nvar createCompleteWebAuthnRegistrationClient_1 = require(\"./createCompleteWebAuthnRegistrationClient\");\nObject.defineProperty(exports, \"createCompleteWebAuthnRegistrationClient\", { enumerable: true, get: function () { return createCompleteWebAuthnRegistrationClient_1.createCompleteWebAuthnRegistrationClient; } });\nvar createListWebAuthnCredentialsClient_1 = require(\"./createListWebAuthnCredentialsClient\");\nObject.defineProperty(exports, \"createListWebAuthnCredentialsClient\", { enumerable: true, get: function () { return createListWebAuthnCredentialsClient_1.createListWebAuthnCredentialsClient; } });\nvar createDeleteWebAuthnCredentialClient_1 = require(\"./createDeleteWebAuthnCredentialClient\");\nObject.defineProperty(exports, \"createDeleteWebAuthnCredentialClient\", { enumerable: true, get: function () { return createDeleteWebAuthnCredentialClient_1.createDeleteWebAuthnC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OAAO,EAAE,0CAA0C,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,0CAA0C,CAAC,wCAAwC,CAAC,EAAE,EAAE,CAAC;AAClN,IAAI,qCAAqC,GAAG,OAAO,CAAC,uCAAuC,CAAC;AAC5F,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qCAAqC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,qCAAqC,CAAC,mCAAmC,CAAC,EAAE,EAAE,CAAC;AACnM,IAAI,sCAAsC,GAAG,OAAO,CAAC,wCAAwC,CAAC;AAC9F,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,sCAAsC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sCAAsC,CAAC,oCAAoC,CAAC,EAAE,EAAE,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/foundation/factories/serviceClients/cognitoIdentityProvider/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDeleteWebAuthnCredentialClient = exports.createListWebAuthnCredentialsClient = exports.createCompleteWebAuthnRegistrationClient = exports.createStartWebAuthnRegistrationClient = exports.createDeleteUserAttributesClient = exports.createListDevicesClient = exports.createUpdateDeviceStatusClient = exports.createVerifyUserAttributeClient = exports.createUpdateUserAttributesClient = exports.createGlobalSignOutClient = exports.createGetUserAttributeVerificationCodeClient = exports.createDeleteUserClient = exports.createForgetDeviceClient = exports.createConfirmDeviceClient = exports.createChangePasswordClient = exports.createGetUserClient = exports.createSetUserMFAPreferenceClient = exports.createAssociateSoftwareTokenClient = exports.createVerifySoftwareTokenClient = exports.createResendConfirmationCodeClient = exports.createRespondToAuthChallengeClient = exports.createConfirmForgotPasswordClient = exports.createForgotPasswordClient = exports.createConfirmSignUpClient = exports.createSignUpClient = exports.createRevokeTokenClient = exports.createGetTokensFromRefreshTokenClient = exports.createInitiateAuthClient = void 0;\nvar createInitiateAuthClient_1 = require(\"./createInitiateAuthClient\");\nObject.defineProperty(exports, \"createInitiateAuthClient\", { enumerable: true, get: function () { return createInitiateAuthClient_1.createInitiateAuthClient; } });\nvar createGetTokensFromRefreshTokenClient_1 = require(\"./createGetTokensFromRefreshTokenClient\");\nObject.defineProperty(exports, \"createGetTokensFromRefreshTokenClient\", { enumerable: true, get: function () { return createGetTokensFromRefreshTokenClient_1.createGetTokensFromRefreshTokenClient; } });\nvar createRevokeTokenClient_1 = require(\"./createRevokeTokenClient\");\nObject.defineProperty(exports, \"createRevokeTokenClient\", { enumerable: true, get: function () { return createRevokeTokenClient_1.createRevokeTokenClient; } });\nvar createSignUpClient_1 = require(\"./createSignUpClient\");\nObject.defineProperty(exports, \"createSignUpClient\", { enumerable: true, get: function () { return createSignUpClient_1.createSignUpClient; } });\nvar createConfirmSignUpClient_1 = require(\"./createConfirmSignUpClient\");\nObject.defineProperty(exports, \"createConfirmSignUpClient\", { enumerable: true, get: function () { return createConfirmSignUpClient_1.createConfirmSignUpClient; } });\nvar createForgotPasswordClient_1 = require(\"./createForgotPasswordClient\");\nObject.defineProperty(exports, \"createForgotPasswordClient\", { enumerable: true, get: function () { return createForgotPasswordClient_1.createForgotPasswordClient; } });\nvar createConfirmForgotPasswordClient_1 = require(\"./createConfirmForgotPasswordClient\");\nObject.defineProperty(exports, \"createConfirmForgotPasswordClient\", { enumerable: true, get: function () { return createConfirmForgotPasswordClient_1.createConfirmForgotPasswordClient; } });\nvar createRespondToAuthChallengeClient_1 = require(\"./createRespondToAuthChallengeClient\");\nObject.defineProperty(exports, \"createRespondToAuthChallengeClient\", { enumerable: true, get: function () { return createRespondToAuthChallengeClient_1.createRespondToAuthChallengeClient; } });\nvar createResendConfirmationCodeClient_1 = require(\"./createResendConfirmationCodeClient\");\nObject.defineProperty(exports, \"createResendConfirmationCodeClient\", { enumerable: true, get: function () { return createResendConfirmationCodeClient_1.createResendConfirmationCodeClient; } });\nvar createVerifySoftwareTokenClient_1 = require(\"./createVerifySoftwareTokenClient\");\nObject.defineProperty(exports, \"createVerifySoftwareTokenClient\", { enumerable: true, get: function () { return createVerifySoftwareTokenClient_1.createVerifySoftwareTokenClient; } });\nvar createAssociateSoftwareTokenClient_1 = require(\"./createAssociateSoftwareTokenClient\");\nObject.defineProperty(exports, \"createAssociateSoftwareTokenClient\", { enumerable: true, get: function () { return createAssociateSoftwareTokenClient_1.createAssociateSoftwareTokenClient; } });\nvar createSetUserMFAPreferenceClient_1 = require(\"./createSetUserMFAPreferenceClient\");\nObject.defineProperty(exports, \"createSetUserMFAPreferenceClient\", { enumerable: true, get: function () { return createSetUserMFAPreferenceClient_1.createSetUserMFAPreferenceClient; } });\nvar createGetUserClient_1 = require(\"./createGetUserClient\");\nObject.defineProperty(exports, \"createGetUserClient\", { enumerable: true, get: function () { return createGetUserClient_1.createGetUserClient; } });\nvar createChangePasswordClient_1 = require(\"./createChangePasswordClient\");\nObject.defineProperty(exports, \"createChangePasswordClient\", { enumerable: true, get: function () { return createChangePasswordClient_1.createChangePasswordClient; } });\nvar createConfirmDeviceClient_1 = require(\"./createConfirmDeviceClient\");\nObject.defineProperty(exports, \"createConfirmDeviceClient\", { enumerable: true, get: function () { return createConfirmDeviceClient_1.createConfirmDeviceClient; } });\nvar createForgetDeviceClient_1 = require(\"./createForgetDeviceClient\");\nObject.defineProperty(exports, \"createForgetDeviceClient\", { enumerable: true, get: function () { return createForgetDeviceClient_1.createForgetDeviceClient; } });\nvar createDeleteUserClient_1 = require(\"./createDeleteUserClient\");\nObject.defineProperty(exports, \"createDeleteUserClient\", { enumerable: true, get: function () { return createDeleteUserClient_1.createDeleteUserClient; } });\nvar createGetUserAttributeVerificationCodeClient_1 = require(\"./createGetUserAttributeVerificationCodeClient\");\nObject.defineProperty(exports, \"createGetUserAttributeVerificationCodeClient\", { enumerable: true, get: function () { return createGetUserAttributeVerificationCodeClient_1.createGetUserAttributeVerificationCodeClient; } });\nvar createGlobalSignOutClient_1 = require(\"./createGlobalSignOutClient\");\nObject.defineProperty(exports, \"createGlobalSignOutClient\", { enumerable: true, get: function () { return createGlobalSignOutClient_1.createGlobalSignOutClient; } });\nvar createUpdateUserAttributesClient_1 = require(\"./createUpdateUserAttributesClient\");\nObject.defineProperty(exports, \"createUpdateUserAttributesClient\", { enumerable: true, get: function () { return createUpdateUserAttributesClient_1.createUpdateUserAttributesClient; } });\nvar createVerifyUserAttributeClient_1 = require(\"./createVerifyUserAttributeClient\");\nObject.defineProperty(exports, \"createVerifyUserAttributeClient\", { enumerable: true, get: function () { return createVerifyUserAttributeClient_1.createVerifyUserAttributeClient; } });\nvar createUpdateDeviceStatusClient_1 = require(\"./createUpdateDeviceStatusClient\");\nObject.defineProperty(exports, \"createUpdateDeviceStatusClient\", { enumerable: true, get: function () { return createUpdateDeviceStatusClient_1.createUpdateDeviceStatusClient; } });\nvar createListDevicesClient_1 = require(\"./createListDevicesClient\");\nObject.defineProperty(exports, \"createListDevicesClient\", { enumerable: true, get: function () { return createListDevicesClient_1.createListDevicesClient; } });\nvar createDeleteUserAttributesClient_1 = require(\"./createDeleteUserAttributesClient\");\nObject.defineProperty(exports, \"createDeleteUserAttributesClient\", { enumerable: true, get: function () { return createDeleteUserAttributesClient_1.createDeleteUserAttributesClient; } });\nvar createStartWebAuthnRegistrationClient_1 = require(\"./createStartWebAuthnRegistrationClient\");\nObject.defineProperty(exports, \"createStartWebAuthnRegistrationClient\", { enumerable: true, get: function () { return createStartWebAuthnRegistrationClient_1.createStartWebAuthnRegistrationClient; } });\nvar createCompleteWebAuthnRegistrationClient_1 = require(\"./createCompleteWebAuthnRegistrationClient\");\nObject.defineProperty(exports, \"createCompleteWebAuthnRegistrationClient\", { enumerable: true, get: function () { return createCompleteWebAuthnRegistrationClient_1.createCompleteWebAuthnRegistrationClient; } });\nvar createListWebAuthnCredentialsClient_1 = require(\"./createListWebAuthnCredentialsClient\");\nObject.defineProperty(exports, \"createListWebAuthnCredentialsClient\", { enumerable: true, get: function () { return createListWebAuthnCredentialsClient_1.createListWebAuthnCredentialsClient; } });\nvar createDeleteWebAuthnCredentialClient_1 = require(\"./createDeleteWebAuthnCredentialClient\");\nObject.defineProperty(exports, \"createDeleteWebAuthnCredentialClient\", { enumerable: true, get: function () { return createDeleteWebAuthnCredentialClient_1.createDeleteWebAuthnCredentialClient; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oCAAoC,GAAG,OAAO,CAAC,mCAAmC,GAAG,OAAO,CAAC,wCAAwC,GAAG,OAAO,CAAC,qCAAqC,GAAG,OAAO,CAAC,gCAAgC,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,8BAA8B,GAAG,OAAO,CAAC,+BAA+B,GAAG,OAAO,CAAC,gCAAgC,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,4CAA4C,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC,gCAAgC,GAAG,OAAO,CAAC,kCAAkC,GAAG,OAAO,CAAC,+BAA+B,GAAG,OAAO,CAAC,kCAAkC,GAAG,OAAO,CAAC,kCAAkC,GAAG,OAAO,CAAC,iCAAiC,GAAG,OAAO,CAAC,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,uBAAuB,GAAG,OAAO,CAAC,qCAAqC,GAAG,OAAO,CAAC,wBAAwB,GAAG,MAAM;AAC1nC,IAAI,0BAA0B,GAAG,OAAO,CAAC,4BAA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_1 = require("../utils/types");
|
|
10
10
|
const AuthError_1 = require("../../../errors/AuthError");
|
|
11
|
-
const cognitoIdentityProvider_1 = require("../../../foundation/factories/serviceClients/cognitoIdentityProvider");
|
|
12
11
|
const factories_1 = require("../factories");
|
|
13
|
-
const
|
|
12
|
+
const cognitoIdentityProvider_1 = require("../../../foundation/factories/serviceClients/cognitoIdentityProvider");
|
|
14
13
|
const refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {
|
|
15
14
|
(0, utils_1.assertTokenProviderConfig)(authConfig?.Cognito);
|
|
16
15
|
const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;
|
|
17
16
|
const region = (0, parsers_1.getRegionFromUserPoolId)(userPoolId);
|
|
18
17
|
(0, types_1.assertAuthTokensWithRefreshToken)(tokens);
|
|
19
|
-
const
|
|
20
|
-
const AuthParameters = {
|
|
21
|
-
REFRESH_TOKEN: refreshTokenString,
|
|
22
|
-
};
|
|
23
|
-
if (tokens.deviceMetadata?.deviceKey) {
|
|
24
|
-
AuthParameters.DEVICE_KEY = tokens.deviceMetadata.deviceKey;
|
|
25
|
-
}
|
|
26
|
-
const UserContextData = (0, userContextData_1.getUserContextData)({
|
|
27
|
-
username,
|
|
28
|
-
userPoolId,
|
|
29
|
-
userPoolClientId,
|
|
30
|
-
});
|
|
31
|
-
const initiateAuth = (0, cognitoIdentityProvider_1.createInitiateAuthClient)({
|
|
18
|
+
const getTokensFromRefreshToken = (0, cognitoIdentityProvider_1.createGetTokensFromRefreshTokenClient)({
|
|
32
19
|
endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({
|
|
33
20
|
endpointOverride: userPoolEndpoint,
|
|
34
21
|
}),
|
|
35
22
|
});
|
|
36
|
-
const { AuthenticationResult } = await
|
|
23
|
+
const { AuthenticationResult } = await getTokensFromRefreshToken({ region }, {
|
|
37
24
|
ClientId: userPoolClientId,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
UserContextData,
|
|
25
|
+
RefreshToken: tokens.refreshToken,
|
|
26
|
+
DeviceKey: tokens.deviceMetadata?.deviceKey,
|
|
41
27
|
});
|
|
42
28
|
const accessToken = (0, utils_1.decodeJWT)(AuthenticationResult?.AccessToken ?? '');
|
|
43
29
|
const idToken = AuthenticationResult?.IdToken
|
|
@@ -56,7 +42,7 @@ const refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {
|
|
|
56
42
|
accessToken,
|
|
57
43
|
idToken,
|
|
58
44
|
clockDrift,
|
|
59
|
-
refreshToken:
|
|
45
|
+
refreshToken: AuthenticationResult?.RefreshToken ?? tokens.refreshToken,
|
|
60
46
|
username,
|
|
61
47
|
};
|
|
62
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshAuthTokens.js","sources":["../../../../../src/providers/cognito/utils/refreshAuthTokens.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.refreshAuthTokensWithoutDedupe = exports.refreshAuthTokens = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst parsers_1 = require(\"../../../foundation/parsers\");\nconst types_1 = require(\"../utils/types\");\nconst AuthError_1 = require(\"../../../errors/AuthError\");\nconst
|
|
1
|
+
{"version":3,"file":"refreshAuthTokens.js","sources":["../../../../../src/providers/cognito/utils/refreshAuthTokens.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.refreshAuthTokensWithoutDedupe = exports.refreshAuthTokens = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst parsers_1 = require(\"../../../foundation/parsers\");\nconst types_1 = require(\"../utils/types\");\nconst AuthError_1 = require(\"../../../errors/AuthError\");\nconst factories_1 = require(\"../factories\");\nconst cognitoIdentityProvider_1 = require(\"../../../foundation/factories/serviceClients/cognitoIdentityProvider\");\nconst refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {\n (0, utils_1.assertTokenProviderConfig)(authConfig?.Cognito);\n const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;\n const region = (0, parsers_1.getRegionFromUserPoolId)(userPoolId);\n (0, types_1.assertAuthTokensWithRefreshToken)(tokens);\n const getTokensFromRefreshToken = (0, cognitoIdentityProvider_1.createGetTokensFromRefreshTokenClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { AuthenticationResult } = await getTokensFromRefreshToken({ region }, {\n ClientId: userPoolClientId,\n RefreshToken: tokens.refreshToken,\n DeviceKey: tokens.deviceMetadata?.deviceKey,\n });\n const accessToken = (0, utils_1.decodeJWT)(AuthenticationResult?.AccessToken ?? '');\n const idToken = AuthenticationResult?.IdToken\n ? (0, utils_1.decodeJWT)(AuthenticationResult.IdToken)\n : undefined;\n const { iat } = accessToken.payload;\n // This should never happen. If it does, it's a bug from the service.\n if (!iat) {\n throw new AuthError_1.AuthError({\n name: 'iatNotFoundException',\n message: 'iat not found in access token',\n });\n }\n const clockDrift = iat * 1000 - new Date().getTime();\n return {\n accessToken,\n idToken,\n clockDrift,\n refreshToken: AuthenticationResult?.RefreshToken ?? tokens.refreshToken,\n username,\n };\n};\nexports.refreshAuthTokens = (0, utils_1.deDupeAsyncFunction)(refreshAuthTokensFunction);\nexports.refreshAuthTokensWithoutDedupe = refreshAuthTokensFunction;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,GAAG,MAAM;AAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM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S,EAAE,oBAAoB,CAAC,OAAO;AAC7D,UAAU,SAAS;AACnB,IAAI,MAAM,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC,OAAO;AACvC;AACA,IAAI,IAAI,CAAC,GAAG,EAAE;AACd,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACxC,YAAY,IAAI,EAAE,sBAAsB;AACxC,YAAY,OAAO,EAAE,+BAA+B;AACpD,SAAS,CAAC;AACV;AACA,IAAI,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;AACxD,IAAI,OAAO;AACX,QAAQ,WAAW;AACnB,QAAQ,OAAO;AACf,QAAQ,UAAU;AAClB,QAAQ,YAAY,EAAE,oBAAoB,EAAE,YAAY,IAAI,MAAM,CAAC,YAAY;AAC/E,QAAQ,QAAQ;AAChB,KAAK;AACL,CAAC;AACD,OAAO,CAAC,iBAAiB,GAAG,IAAI,OAAO,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;AACvF,OAAO,CAAC,8BAA8B,GAAG,yBAAyB;;"}
|
|
@@ -5,8 +5,8 @@ import '../../../providers/cognito/utils/srp/constants.mjs';
|
|
|
5
5
|
import '@aws-crypto/sha256-js';
|
|
6
6
|
import { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';
|
|
7
7
|
import '@aws-amplify/core/internals/aws-client-utils/composers';
|
|
8
|
-
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
9
8
|
import '@aws-amplify/core/internals/aws-client-utils';
|
|
9
|
+
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
10
10
|
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';
|
|
11
11
|
import '../../../common/AuthErrorStrings.mjs';
|
|
12
12
|
import '../../../errors/types/validation.mjs';
|
|
@@ -2,8 +2,8 @@ import { AuthAction } from '@aws-amplify/core/internals/utils';
|
|
|
2
2
|
import { getUserContextData } from '../../../providers/cognito/utils/userContextData.mjs';
|
|
3
3
|
import { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';
|
|
4
4
|
import '@aws-amplify/core/internals/aws-client-utils/composers';
|
|
5
|
-
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
6
5
|
import '@aws-amplify/core/internals/aws-client-utils';
|
|
6
|
+
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
7
7
|
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';
|
|
8
8
|
import '../../../common/AuthErrorStrings.mjs';
|
|
9
9
|
import { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GetTokensFromRefreshTokenCommandInput, GetTokensFromRefreshTokenCommandOutput, ServiceClientFactoryInput } from './types';
|
|
2
|
+
export declare const createGetTokensFromRefreshTokenClient: (config: ServiceClientFactoryInput) => (config: {
|
|
3
|
+
endpointResolver?: (((options: import("@aws-amplify/core/internals/aws-client-utils").EndpointResolverOptions, input?: any) => import("@aws-amplify/core/internals/aws-client-utils").Endpoint) & ((options: import("@aws-amplify/core/internals/aws-client-utils").EndpointResolverOptions) => {
|
|
4
|
+
url: URL;
|
|
5
|
+
})) | undefined;
|
|
6
|
+
service?: string | undefined;
|
|
7
|
+
retryDecider?: (((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse | undefined, error?: unknown, middlewareContext?: import("@aws-amplify/core/internals/aws-client-utils").MiddlewareContext) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>) & ((response?: import("@aws-amplify/core/internals/aws-client-utils").HttpResponse, error?: unknown) => Promise<import("@aws-amplify/core/internals/aws-client-utils").RetryDeciderOutput>)) | undefined;
|
|
8
|
+
computeDelay?: ((attempt: number) => number) | undefined;
|
|
9
|
+
userAgentValue?: string | undefined;
|
|
10
|
+
cache?: "default" | "no-store" | "force-cache" | "no-cache" | "only-if-cached" | "reload" | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
}, input: GetTokensFromRefreshTokenCommandInput) => Promise<GetTokensFromRefreshTokenCommandOutput>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';
|
|
2
|
+
import { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';
|
|
3
|
+
import { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';
|
|
4
|
+
import '@aws-amplify/core/internals/aws-client-utils';
|
|
5
|
+
import '@aws-amplify/core/internals/utils';
|
|
6
|
+
import { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
7
|
+
import { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';
|
|
8
|
+
|
|
9
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
10
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
11
|
+
const createGetTokensFromRefreshTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GetTokensFromRefreshToken'), createUserPoolDeserializer(), {
|
|
12
|
+
...DEFAULT_SERVICE_CLIENT_API_CONFIG,
|
|
13
|
+
...config,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { createGetTokensFromRefreshTokenClient };
|
|
17
|
+
//# sourceMappingURL=createGetTokensFromRefreshTokenClient.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createGetTokensFromRefreshTokenClient.mjs","sources":["../../../../../../src/foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { createUserPoolDeserializer, createUserPoolSerializer, } from './shared/serde';\nimport { cognitoUserPoolTransferHandler } from './shared/handler';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants';\nexport const createGetTokensFromRefreshTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GetTokensFromRefreshToken'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAKY,MAAC,qCAAqC,GAAG,CAAC,MAAM,KAAK,iBAAiB,CAAC,8BAA8B,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,EAAE,0BAA0B,EAAE,EAAE;AACxM,IAAI,GAAG,iCAAiC;AACxC,IAAI,GAAG,MAAM;AACb,CAAC;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createInitiateAuthClient } from './createInitiateAuthClient';
|
|
2
|
+
export { createGetTokensFromRefreshTokenClient } from './createGetTokensFromRefreshTokenClient';
|
|
2
3
|
export { createRevokeTokenClient } from './createRevokeTokenClient';
|
|
3
4
|
export { createSignUpClient } from './createSignUpClient';
|
|
4
5
|
export { createConfirmSignUpClient } from './createConfirmSignUpClient';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { createInitiateAuthClient } from './createInitiateAuthClient.mjs';
|
|
2
|
+
export { createGetTokensFromRefreshTokenClient } from './createGetTokensFromRefreshTokenClient.mjs';
|
|
2
3
|
export { createRevokeTokenClient } from './createRevokeTokenClient.mjs';
|
|
3
4
|
export { createSignUpClient } from './createSignUpClient.mjs';
|
|
4
5
|
export { createConfirmSignUpClient } from './createConfirmSignUpClient.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Endpoint, HttpRequest } from '@aws-amplify/core/internals/aws-client-utils';
|
|
2
|
-
type ClientOperation = 'SignUp' | 'ConfirmSignUp' | 'ForgotPassword' | 'ConfirmForgotPassword' | 'InitiateAuth' | 'RespondToAuthChallenge' | 'ResendConfirmationCode' | 'VerifySoftwareToken' | 'AssociateSoftwareToken' | 'SetUserMFAPreference' | 'GetUser' | 'ChangePassword' | 'ConfirmDevice' | 'ForgetDevice' | 'DeleteUser' | 'GetUserAttributeVerificationCode' | 'GlobalSignOut' | 'UpdateUserAttributes' | 'VerifyUserAttribute' | 'DeleteUserAttributes' | 'UpdateDeviceStatus' | 'ListDevices' | 'RevokeToken' | 'StartWebAuthnRegistration' | 'CompleteWebAuthnRegistration' | 'ListWebAuthnCredentials' | 'DeleteWebAuthnCredential';
|
|
2
|
+
type ClientOperation = 'SignUp' | 'ConfirmSignUp' | 'ForgotPassword' | 'ConfirmForgotPassword' | 'InitiateAuth' | 'GetTokensFromRefreshToken' | 'RespondToAuthChallenge' | 'ResendConfirmationCode' | 'VerifySoftwareToken' | 'AssociateSoftwareToken' | 'SetUserMFAPreference' | 'GetUser' | 'ChangePassword' | 'ConfirmDevice' | 'ForgetDevice' | 'DeleteUser' | 'GetUserAttributeVerificationCode' | 'GlobalSignOut' | 'UpdateUserAttributes' | 'VerifyUserAttribute' | 'DeleteUserAttributes' | 'UpdateDeviceStatus' | 'ListDevices' | 'RevokeToken' | 'StartWebAuthnRegistration' | 'CompleteWebAuthnRegistration' | 'ListWebAuthnCredentials' | 'DeleteWebAuthnCredential';
|
|
3
3
|
export declare const createUserPoolSerializer: <Input>(operation: ClientOperation) => (input: Input, endpoint: Endpoint) => HttpRequest;
|
|
4
4
|
export {};
|
|
@@ -54,6 +54,96 @@ declare enum VerifySoftwareTokenResponseType {
|
|
|
54
54
|
ERROR = "ERROR",
|
|
55
55
|
SUCCESS = "SUCCESS"
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* @public
|
|
59
|
+
*
|
|
60
|
+
* The input for {@link GetTokensFromRefreshTokenCommand}.
|
|
61
|
+
*/
|
|
62
|
+
export interface GetTokensFromRefreshTokenCommandInput extends GetTokensFromRefreshTokenRequest {
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @public
|
|
66
|
+
*
|
|
67
|
+
* The output of {@link GetTokensFromRefreshTokenCommand}.
|
|
68
|
+
*/
|
|
69
|
+
export interface GetTokensFromRefreshTokenCommandOutput extends GetTokensFromRefreshTokenResponse, __MetadataBearer {
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export interface GetTokensFromRefreshTokenRequest {
|
|
75
|
+
/**
|
|
76
|
+
* <p>A valid refresh token that can authorize the request for new tokens. When refresh
|
|
77
|
+
* token rotation is active in the requested app client, this token is invalidated after
|
|
78
|
+
* the request is complete.</p>
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
RefreshToken: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* <p>The app client that issued the refresh token to the user who wants to request new
|
|
84
|
+
* tokens.</p>
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
ClientId: string | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* <p>The client secret of the requested app client, if the client has a secret.</p>
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
ClientSecret?: string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* <p>When you enable device remembering, Amazon Cognito issues a device key that you can use for
|
|
95
|
+
* device authentication that bypasses multi-factor authentication (MFA). To implement
|
|
96
|
+
* <code>GetTokensFromRefreshToken</code> in a user pool with device remembering, you
|
|
97
|
+
* must capture the device key from the initial authentication request. If your application
|
|
98
|
+
* doesn't provide the key of a registered device, Amazon Cognito issues a new one. You must
|
|
99
|
+
* provide the confirmed device key in this request if device remembering is
|
|
100
|
+
* enabled in your user pool.</p>
|
|
101
|
+
* <p>For more information about device remembering, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html">Working with devices</a>.</p>
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
DeviceKey?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* <p>A map of custom key-value pairs that you can provide as input for certain custom
|
|
107
|
+
* workflows that this action triggers.</p>
|
|
108
|
+
* <p>You create custom workflows by assigning Lambda functions to user pool triggers.
|
|
109
|
+
* When you use the <code>GetTokensFromRefreshToken</code> API action, Amazon Cognito invokes the
|
|
110
|
+
* Lambda function the pre token generation trigger.</p>
|
|
111
|
+
* <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html">
|
|
112
|
+
* Using Lambda triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
|
|
113
|
+
* <note>
|
|
114
|
+
* <p>When you use the <code>ClientMetadata</code> parameter, note that Amazon Cognito won't do the
|
|
115
|
+
* following:</p>
|
|
116
|
+
* <ul>
|
|
117
|
+
* <li>
|
|
118
|
+
* <p>Store the <code>ClientMetadata</code> value. This data is available only
|
|
119
|
+
* to Lambda triggers that are assigned to a user pool to support custom
|
|
120
|
+
* workflows. If your user pool configuration doesn't include triggers, the
|
|
121
|
+
* <code>ClientMetadata</code> parameter serves no purpose.</p>
|
|
122
|
+
* </li>
|
|
123
|
+
* <li>
|
|
124
|
+
* <p>Validate the <code>ClientMetadata</code> value.</p>
|
|
125
|
+
* </li>
|
|
126
|
+
* <li>
|
|
127
|
+
* <p>Encrypt the <code>ClientMetadata</code> value. Don't send sensitive
|
|
128
|
+
* information in this parameter.</p>
|
|
129
|
+
* </li>
|
|
130
|
+
* </ul>
|
|
131
|
+
* </note>
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
ClientMetadata?: Record<string, string> | undefined;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
export interface GetTokensFromRefreshTokenResponse {
|
|
140
|
+
/**
|
|
141
|
+
* <p>The object that your application receives after authentication. Contains tokens and
|
|
142
|
+
* information for device authentication.</p>
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
AuthenticationResult?: AuthenticationResultType | undefined;
|
|
146
|
+
}
|
|
57
147
|
/**
|
|
58
148
|
* <p>An Amazon Pinpoint analytics endpoint.</p>
|
|
59
149
|
* <p>An endpoint uniquely identifies a mobile device, email address, or phone number that can receive messages from Amazon Pinpoint analytics.</p>
|
|
@@ -2,17 +2,16 @@ import { deDupeAsyncFunction, assertTokenProviderConfig, decodeJWT } from '@aws-
|
|
|
2
2
|
import { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';
|
|
3
3
|
import { assertAuthTokensWithRefreshToken } from './types.mjs';
|
|
4
4
|
import { AuthError } from '../../../errors/AuthError.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';
|
|
6
|
+
import '@aws-amplify/core';
|
|
6
7
|
import '@aws-amplify/core/internals/aws-client-utils/composers';
|
|
7
|
-
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
8
8
|
import '@aws-amplify/core/internals/aws-client-utils';
|
|
9
|
+
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
9
10
|
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';
|
|
11
|
+
import { createGetTokensFromRefreshTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGetTokensFromRefreshTokenClient.mjs';
|
|
10
12
|
import '../../../common/AuthErrorStrings.mjs';
|
|
11
13
|
import '../../../errors/types/validation.mjs';
|
|
12
14
|
import '../types/errors.mjs';
|
|
13
|
-
import { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';
|
|
14
|
-
import '@aws-amplify/core';
|
|
15
|
-
import { getUserContextData } from './userContextData.mjs';
|
|
16
15
|
|
|
17
16
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
18
17
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -21,28 +20,15 @@ const refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {
|
|
|
21
20
|
const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;
|
|
22
21
|
const region = getRegionFromUserPoolId(userPoolId);
|
|
23
22
|
assertAuthTokensWithRefreshToken(tokens);
|
|
24
|
-
const
|
|
25
|
-
const AuthParameters = {
|
|
26
|
-
REFRESH_TOKEN: refreshTokenString,
|
|
27
|
-
};
|
|
28
|
-
if (tokens.deviceMetadata?.deviceKey) {
|
|
29
|
-
AuthParameters.DEVICE_KEY = tokens.deviceMetadata.deviceKey;
|
|
30
|
-
}
|
|
31
|
-
const UserContextData = getUserContextData({
|
|
32
|
-
username,
|
|
33
|
-
userPoolId,
|
|
34
|
-
userPoolClientId,
|
|
35
|
-
});
|
|
36
|
-
const initiateAuth = createInitiateAuthClient({
|
|
23
|
+
const getTokensFromRefreshToken = createGetTokensFromRefreshTokenClient({
|
|
37
24
|
endpointResolver: createCognitoUserPoolEndpointResolver({
|
|
38
25
|
endpointOverride: userPoolEndpoint,
|
|
39
26
|
}),
|
|
40
27
|
});
|
|
41
|
-
const { AuthenticationResult } = await
|
|
28
|
+
const { AuthenticationResult } = await getTokensFromRefreshToken({ region }, {
|
|
42
29
|
ClientId: userPoolClientId,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
UserContextData,
|
|
30
|
+
RefreshToken: tokens.refreshToken,
|
|
31
|
+
DeviceKey: tokens.deviceMetadata?.deviceKey,
|
|
46
32
|
});
|
|
47
33
|
const accessToken = decodeJWT(AuthenticationResult?.AccessToken ?? '');
|
|
48
34
|
const idToken = AuthenticationResult?.IdToken
|
|
@@ -61,7 +47,7 @@ const refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {
|
|
|
61
47
|
accessToken,
|
|
62
48
|
idToken,
|
|
63
49
|
clockDrift,
|
|
64
|
-
refreshToken:
|
|
50
|
+
refreshToken: AuthenticationResult?.RefreshToken ?? tokens.refreshToken,
|
|
65
51
|
username,
|
|
66
52
|
};
|
|
67
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshAuthTokens.mjs","sources":["../../../../../src/providers/cognito/utils/refreshAuthTokens.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { assertTokenProviderConfig, deDupeAsyncFunction, decodeJWT, } from '@aws-amplify/core/internals/utils';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers';\nimport { assertAuthTokensWithRefreshToken } from '../utils/types';\nimport { AuthError } from '../../../errors/AuthError';\nimport {
|
|
1
|
+
{"version":3,"file":"refreshAuthTokens.mjs","sources":["../../../../../src/providers/cognito/utils/refreshAuthTokens.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { assertTokenProviderConfig, deDupeAsyncFunction, decodeJWT, } from '@aws-amplify/core/internals/utils';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers';\nimport { assertAuthTokensWithRefreshToken } from '../utils/types';\nimport { AuthError } from '../../../errors/AuthError';\nimport { createCognitoUserPoolEndpointResolver } from '../factories';\nimport { createGetTokensFromRefreshTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider';\nconst refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {\n assertTokenProviderConfig(authConfig?.Cognito);\n const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;\n const region = getRegionFromUserPoolId(userPoolId);\n assertAuthTokensWithRefreshToken(tokens);\n const getTokensFromRefreshToken = createGetTokensFromRefreshTokenClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { AuthenticationResult } = await getTokensFromRefreshToken({ region }, {\n ClientId: userPoolClientId,\n RefreshToken: tokens.refreshToken,\n DeviceKey: tokens.deviceMetadata?.deviceKey,\n });\n const accessToken = decodeJWT(AuthenticationResult?.AccessToken ?? '');\n const idToken = AuthenticationResult?.IdToken\n ? decodeJWT(AuthenticationResult.IdToken)\n : undefined;\n const { iat } = accessToken.payload;\n // This should never happen. If it does, it's a bug from the service.\n if (!iat) {\n throw new AuthError({\n name: 'iatNotFoundException',\n message: 'iat not found in access token',\n });\n }\n const clockDrift = iat * 1000 - new Date().getTime();\n return {\n accessToken,\n idToken,\n clockDrift,\n refreshToken: AuthenticationResult?.RefreshToken ?? tokens.refreshToken,\n username,\n };\n};\nexport const refreshAuthTokens = deDupeAsyncFunction(refreshAuthTokensFunction);\nexport const refreshAuthTokensWithoutDedupe = refreshAuthTokensFunction;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AAOA,MAAM,yBAAyB,GAAG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAG,KAAK;AAC/E,IAAI,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC;AAClD,IAAI,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,OAAO;AACjF,IAAI,MAAM,MAAM,GAAG,uBAAuB,CAAC,UAAU,CAAC;AACtD,IAAI,gCAAgC,CAAC,MAAM,CAAC;AAC5C,IAAI,MAAM,yBAAyB,GAAG,qCAAqC,CAAC;AAC5E,QAAQ,gBAAgB,EAAE,qCAAqC,CAAC;AAChE,YAAY,gBAAgB,EAAE,gBAAgB;AAC9C,SAAS,CAAC;AACV,KAAK,CAAC;AACN,IAAI,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,yBAAyB,CAAC,EAAE,MAAM,EAAE,EAAE;AACjF,QAAQ,QAAQ,EAAE,gBAAgB;AAClC,QAAQ,YAAY,EAAE,MAAM,CAAC,YAAY;AACzC,QAAQ,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,SAAS;AACnD,KAAK,CAAC;AACN,IAAI,MAAM,WAAW,GAAG,SAAS,CAAC,oBAAoB,EAAE,WAAW,IAAI,EAAE,CAAC;AAC1E,IAAI,MAAM,OAAO,GAAG,oBAAoB,EAAE;AAC1C,UAAU,SAAS,CAAC,oBAAoB,CAAC,OAAO;AAChD,UAAU,SAAS;AACnB,IAAI,MAAM,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC,OAAO;AACvC;AACA,IAAI,IAAI,CAAC,GAAG,EAAE;AACd,QAAQ,MAAM,IAAI,SAAS,CAAC;AAC5B,YAAY,IAAI,EAAE,sBAAsB;AACxC,YAAY,OAAO,EAAE,+BAA+B;AACpD,SAAS,CAAC;AACV;AACA,IAAI,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;AACxD,IAAI,OAAO;AACX,QAAQ,WAAW;AACnB,QAAQ,OAAO;AACf,QAAQ,UAAU;AAClB,QAAQ,YAAY,EAAE,oBAAoB,EAAE,YAAY,IAAI,MAAM,CAAC,YAAY;AAC/E,QAAQ,QAAQ;AAChB,KAAK;AACL,CAAC;AACW,MAAC,iBAAiB,GAAG,mBAAmB,CAAC,yBAAyB;AAClE,MAAC,8BAA8B,GAAG;;;;"}
|
|
@@ -10,8 +10,8 @@ import { getCurrentUser } from '../apis/getCurrentUser.mjs';
|
|
|
10
10
|
import { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';
|
|
11
11
|
import { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';
|
|
12
12
|
import '@aws-amplify/core/internals/aws-client-utils/composers';
|
|
13
|
-
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
14
13
|
import '@aws-amplify/core/internals/aws-client-utils';
|
|
14
|
+
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';
|
|
15
15
|
import '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';
|
|
16
16
|
import { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';
|
|
17
17
|
import { createVerifySoftwareTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createVerifySoftwareTokenClient.mjs';
|
package/package.json
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
2
|
+
"name": "@aws-amplify/auth",
|
|
3
|
+
"version": "6.13.4-unstable.16ac204.0+16ac204",
|
|
4
|
+
"description": "Auth category of aws-amplify",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"typings": "./dist/esm/index.d.ts",
|
|
8
|
+
"react-native": "./dist/cjs/index.js",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"./dist/cjs/providers/cognito/apis/signInWithRedirect.js",
|
|
11
|
+
"./dist/esm/providers/cognito/apis/signInWithRedirect.mjs",
|
|
12
|
+
"./dist/cjs/providers/cognito/utils/oauth/enableOAuthListener.js",
|
|
13
|
+
"./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "yarn lint --fix && jest -w 1 --coverage --logHeapUsage",
|
|
20
|
+
"build-with-test": "npm test && npm run build",
|
|
21
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
22
|
+
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
|
|
23
|
+
"build:watch": "npm run build:esm-cjs -- --watch",
|
|
24
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
25
|
+
"clean": "npm run clean:size && rimraf lib-esm lib dist",
|
|
26
|
+
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
27
|
+
"format": "echo \"Not implemented\"",
|
|
28
|
+
"lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
|
|
29
|
+
"lint:fix": "eslint '**/*.{ts,tsx}' --fix",
|
|
30
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 91.18"
|
|
31
|
+
},
|
|
32
|
+
"typesVersions": {
|
|
33
|
+
">=4.2": {
|
|
34
|
+
"cognito": [
|
|
35
|
+
"./dist/esm/providers/cognito/index.d.ts"
|
|
36
|
+
],
|
|
37
|
+
"cognito/server": [
|
|
38
|
+
"./dist/esm/providers/cognito/apis/server/index.d.ts"
|
|
39
|
+
],
|
|
40
|
+
"server": [
|
|
41
|
+
"./dist/esm/server.d.ts"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"react-native": "./dist/cjs/index.js",
|
|
48
|
+
"types": "./dist/esm/index.d.ts",
|
|
49
|
+
"import": "./dist/esm/index.mjs",
|
|
50
|
+
"require": "./dist/cjs/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./cognito": {
|
|
53
|
+
"react-native": "./dist/cjs/providers/cognito/index.js",
|
|
54
|
+
"types": "./dist/esm/providers/cognito/index.d.ts",
|
|
55
|
+
"import": "./dist/esm/providers/cognito/index.mjs",
|
|
56
|
+
"require": "./dist/cjs/providers/cognito/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./cognito/server": {
|
|
59
|
+
"types": "./dist/esm/providers/cognito/apis/server/index.d.ts",
|
|
60
|
+
"import": "./dist/esm/providers/cognito/apis/server/index.mjs",
|
|
61
|
+
"require": "./dist/cjs/providers/cognito/apis/server/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./server": {
|
|
64
|
+
"types": "./dist/esm/server.d.ts",
|
|
65
|
+
"import": "./dist/esm/server.mjs",
|
|
66
|
+
"require": "./dist/cjs/server.js"
|
|
67
|
+
},
|
|
68
|
+
"./enable-oauth-listener": {
|
|
69
|
+
"types": "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.d.ts",
|
|
70
|
+
"import": "./dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs",
|
|
71
|
+
"require": "./dist/cjs/providers/cognito/utils/oauth/enableOAuthListener.js"
|
|
72
|
+
},
|
|
73
|
+
"./package.json": "./package.json"
|
|
74
|
+
},
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
78
|
+
},
|
|
79
|
+
"author": "Amazon Web Services",
|
|
80
|
+
"license": "Apache-2.0",
|
|
81
|
+
"bugs": {
|
|
82
|
+
"url": "https://github.com/aws/aws-amplify/issues"
|
|
83
|
+
},
|
|
84
|
+
"homepage": "https://aws-amplify.github.io/",
|
|
85
|
+
"files": [
|
|
86
|
+
"dist/cjs",
|
|
87
|
+
"dist/esm",
|
|
88
|
+
"src",
|
|
89
|
+
"cognito",
|
|
90
|
+
"server",
|
|
91
|
+
"enable-oauth-listener"
|
|
92
|
+
],
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"@aws-crypto/sha256-js": "5.2.0",
|
|
95
|
+
"@smithy/types": "^3.3.0",
|
|
96
|
+
"tslib": "^2.5.0"
|
|
97
|
+
},
|
|
98
|
+
"peerDependencies": {
|
|
99
|
+
"@aws-amplify/core": "6.12.4-unstable.16ac204.0+16ac204"
|
|
100
|
+
},
|
|
101
|
+
"devDependencies": {
|
|
102
|
+
"@aws-amplify/core": "6.12.4-unstable.16ac204.0+16ac204",
|
|
103
|
+
"@aws-amplify/react-native": "1.1.11-unstable.16ac204.0+16ac204",
|
|
104
|
+
"@jest/test-sequencer": "^29.7.0"
|
|
105
|
+
},
|
|
106
|
+
"gitHead": "16ac204d1c1e67c2a95d6c9794310a89c195dc2f"
|
|
107
107
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
GetTokensFromRefreshTokenCommandInput,
|
|
8
|
+
GetTokensFromRefreshTokenCommandOutput,
|
|
9
|
+
ServiceClientFactoryInput,
|
|
10
|
+
} from './types';
|
|
11
|
+
import {
|
|
12
|
+
createUserPoolDeserializer,
|
|
13
|
+
createUserPoolSerializer,
|
|
14
|
+
} from './shared/serde';
|
|
15
|
+
import { cognitoUserPoolTransferHandler } from './shared/handler';
|
|
16
|
+
import { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants';
|
|
17
|
+
|
|
18
|
+
export const createGetTokensFromRefreshTokenClient = (
|
|
19
|
+
config: ServiceClientFactoryInput,
|
|
20
|
+
) =>
|
|
21
|
+
composeServiceApi(
|
|
22
|
+
cognitoUserPoolTransferHandler,
|
|
23
|
+
createUserPoolSerializer<GetTokensFromRefreshTokenCommandInput>(
|
|
24
|
+
'GetTokensFromRefreshToken',
|
|
25
|
+
),
|
|
26
|
+
createUserPoolDeserializer<GetTokensFromRefreshTokenCommandOutput>(),
|
|
27
|
+
{
|
|
28
|
+
...DEFAULT_SERVICE_CLIENT_API_CONFIG,
|
|
29
|
+
...config,
|
|
30
|
+
},
|
|
31
|
+
);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
export { createInitiateAuthClient } from './createInitiateAuthClient';
|
|
5
|
+
export { createGetTokensFromRefreshTokenClient } from './createGetTokensFromRefreshTokenClient';
|
|
5
6
|
export { createRevokeTokenClient } from './createRevokeTokenClient';
|
|
6
7
|
export { createSignUpClient } from './createSignUpClient';
|
|
7
8
|
export { createConfirmSignUpClient } from './createConfirmSignUpClient';
|
|
@@ -408,6 +408,99 @@ declare namespace DeleteUserAttributesResponse {
|
|
|
408
408
|
*/
|
|
409
409
|
const filterSensitiveLog: (obj: DeleteUserAttributesResponse) => any;
|
|
410
410
|
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* @public
|
|
414
|
+
*
|
|
415
|
+
* The input for {@link GetTokensFromRefreshTokenCommand}.
|
|
416
|
+
*/
|
|
417
|
+
export interface GetTokensFromRefreshTokenCommandInput
|
|
418
|
+
extends GetTokensFromRefreshTokenRequest {}
|
|
419
|
+
/**
|
|
420
|
+
* @public
|
|
421
|
+
*
|
|
422
|
+
* The output of {@link GetTokensFromRefreshTokenCommand}.
|
|
423
|
+
*/
|
|
424
|
+
export interface GetTokensFromRefreshTokenCommandOutput
|
|
425
|
+
extends GetTokensFromRefreshTokenResponse,
|
|
426
|
+
__MetadataBearer {}
|
|
427
|
+
/**
|
|
428
|
+
* @public
|
|
429
|
+
*/
|
|
430
|
+
export interface GetTokensFromRefreshTokenRequest {
|
|
431
|
+
/**
|
|
432
|
+
* <p>A valid refresh token that can authorize the request for new tokens. When refresh
|
|
433
|
+
* token rotation is active in the requested app client, this token is invalidated after
|
|
434
|
+
* the request is complete.</p>
|
|
435
|
+
* @public
|
|
436
|
+
*/
|
|
437
|
+
RefreshToken: string | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* <p>The app client that issued the refresh token to the user who wants to request new
|
|
440
|
+
* tokens.</p>
|
|
441
|
+
* @public
|
|
442
|
+
*/
|
|
443
|
+
ClientId: string | undefined;
|
|
444
|
+
/**
|
|
445
|
+
* <p>The client secret of the requested app client, if the client has a secret.</p>
|
|
446
|
+
* @public
|
|
447
|
+
*/
|
|
448
|
+
ClientSecret?: string | undefined;
|
|
449
|
+
/**
|
|
450
|
+
* <p>When you enable device remembering, Amazon Cognito issues a device key that you can use for
|
|
451
|
+
* device authentication that bypasses multi-factor authentication (MFA). To implement
|
|
452
|
+
* <code>GetTokensFromRefreshToken</code> in a user pool with device remembering, you
|
|
453
|
+
* must capture the device key from the initial authentication request. If your application
|
|
454
|
+
* doesn't provide the key of a registered device, Amazon Cognito issues a new one. You must
|
|
455
|
+
* provide the confirmed device key in this request if device remembering is
|
|
456
|
+
* enabled in your user pool.</p>
|
|
457
|
+
* <p>For more information about device remembering, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html">Working with devices</a>.</p>
|
|
458
|
+
* @public
|
|
459
|
+
*/
|
|
460
|
+
DeviceKey?: string | undefined;
|
|
461
|
+
/**
|
|
462
|
+
* <p>A map of custom key-value pairs that you can provide as input for certain custom
|
|
463
|
+
* workflows that this action triggers.</p>
|
|
464
|
+
* <p>You create custom workflows by assigning Lambda functions to user pool triggers.
|
|
465
|
+
* When you use the <code>GetTokensFromRefreshToken</code> API action, Amazon Cognito invokes the
|
|
466
|
+
* Lambda function the pre token generation trigger.</p>
|
|
467
|
+
* <p>For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html">
|
|
468
|
+
* Using Lambda triggers</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
|
|
469
|
+
* <note>
|
|
470
|
+
* <p>When you use the <code>ClientMetadata</code> parameter, note that Amazon Cognito won't do the
|
|
471
|
+
* following:</p>
|
|
472
|
+
* <ul>
|
|
473
|
+
* <li>
|
|
474
|
+
* <p>Store the <code>ClientMetadata</code> value. This data is available only
|
|
475
|
+
* to Lambda triggers that are assigned to a user pool to support custom
|
|
476
|
+
* workflows. If your user pool configuration doesn't include triggers, the
|
|
477
|
+
* <code>ClientMetadata</code> parameter serves no purpose.</p>
|
|
478
|
+
* </li>
|
|
479
|
+
* <li>
|
|
480
|
+
* <p>Validate the <code>ClientMetadata</code> value.</p>
|
|
481
|
+
* </li>
|
|
482
|
+
* <li>
|
|
483
|
+
* <p>Encrypt the <code>ClientMetadata</code> value. Don't send sensitive
|
|
484
|
+
* information in this parameter.</p>
|
|
485
|
+
* </li>
|
|
486
|
+
* </ul>
|
|
487
|
+
* </note>
|
|
488
|
+
* @public
|
|
489
|
+
*/
|
|
490
|
+
ClientMetadata?: Record<string, string> | undefined;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* @public
|
|
494
|
+
*/
|
|
495
|
+
export interface GetTokensFromRefreshTokenResponse {
|
|
496
|
+
/**
|
|
497
|
+
* <p>The object that your application receives after authentication. Contains tokens and
|
|
498
|
+
* information for device authentication.</p>
|
|
499
|
+
* @public
|
|
500
|
+
*/
|
|
501
|
+
AuthenticationResult?: AuthenticationResultType | undefined;
|
|
502
|
+
}
|
|
503
|
+
|
|
411
504
|
/**
|
|
412
505
|
* <p>An Amazon Pinpoint analytics endpoint.</p>
|
|
413
506
|
* <p>An endpoint uniquely identifies a mobile device, email address, or phone number that can receive messages from Amazon Pinpoint analytics.</p>
|
|
@@ -12,10 +12,8 @@ import { CognitoAuthTokens, TokenRefresher } from '../tokenProvider/types';
|
|
|
12
12
|
import { getRegionFromUserPoolId } from '../../../foundation/parsers';
|
|
13
13
|
import { assertAuthTokensWithRefreshToken } from '../utils/types';
|
|
14
14
|
import { AuthError } from '../../../errors/AuthError';
|
|
15
|
-
import { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider';
|
|
16
15
|
import { createCognitoUserPoolEndpointResolver } from '../factories';
|
|
17
|
-
|
|
18
|
-
import { getUserContextData } from './userContextData';
|
|
16
|
+
import { createGetTokensFromRefreshTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider';
|
|
19
17
|
|
|
20
18
|
const refreshAuthTokensFunction: TokenRefresher = async ({
|
|
21
19
|
tokens,
|
|
@@ -30,34 +28,19 @@ const refreshAuthTokensFunction: TokenRefresher = async ({
|
|
|
30
28
|
const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;
|
|
31
29
|
const region = getRegionFromUserPoolId(userPoolId);
|
|
32
30
|
assertAuthTokensWithRefreshToken(tokens);
|
|
33
|
-
const refreshTokenString = tokens.refreshToken;
|
|
34
|
-
|
|
35
|
-
const AuthParameters: Record<string, string> = {
|
|
36
|
-
REFRESH_TOKEN: refreshTokenString,
|
|
37
|
-
};
|
|
38
|
-
if (tokens.deviceMetadata?.deviceKey) {
|
|
39
|
-
AuthParameters.DEVICE_KEY = tokens.deviceMetadata.deviceKey;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const UserContextData = getUserContextData({
|
|
43
|
-
username,
|
|
44
|
-
userPoolId,
|
|
45
|
-
userPoolClientId,
|
|
46
|
-
});
|
|
47
31
|
|
|
48
|
-
const
|
|
32
|
+
const getTokensFromRefreshToken = createGetTokensFromRefreshTokenClient({
|
|
49
33
|
endpointResolver: createCognitoUserPoolEndpointResolver({
|
|
50
34
|
endpointOverride: userPoolEndpoint,
|
|
51
35
|
}),
|
|
52
36
|
});
|
|
53
37
|
|
|
54
|
-
const { AuthenticationResult } = await
|
|
38
|
+
const { AuthenticationResult } = await getTokensFromRefreshToken(
|
|
55
39
|
{ region },
|
|
56
40
|
{
|
|
57
41
|
ClientId: userPoolClientId,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
UserContextData,
|
|
42
|
+
RefreshToken: tokens.refreshToken,
|
|
43
|
+
DeviceKey: tokens.deviceMetadata?.deviceKey,
|
|
61
44
|
},
|
|
62
45
|
);
|
|
63
46
|
|
|
@@ -79,7 +62,7 @@ const refreshAuthTokensFunction: TokenRefresher = async ({
|
|
|
79
62
|
accessToken,
|
|
80
63
|
idToken,
|
|
81
64
|
clockDrift,
|
|
82
|
-
refreshToken:
|
|
65
|
+
refreshToken: AuthenticationResult?.RefreshToken ?? tokens.refreshToken,
|
|
83
66
|
username,
|
|
84
67
|
};
|
|
85
68
|
};
|