diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/synthesize-resources.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/synthesize-resources.ts index bd6697d5b7a..158fddeb974 100644 --- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/synthesize-resources.ts +++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/utils/synthesize-resources.ts @@ -405,6 +405,7 @@ const createAdminAuthAPI = async (context: any, authResourceName: string, functi const backendConfigs = { service: 'API Gateway', providerPlugin: 'awscloudformation', + authorizationType: 'AMAZON_COGNITO_USER_POOLS', dependsOn, }; diff --git a/packages/amplify-frontend-android/lib/amplify-config-helper.js b/packages/amplify-frontend-android/lib/amplify-config-helper.js index 64f55040fef..59edc9e233e 100644 --- a/packages/amplify-frontend-android/lib/amplify-config-helper.js +++ b/packages/amplify-frontend-android/lib/amplify-config-helper.js @@ -77,7 +77,7 @@ function constructApi(metadata, amplifyConfig) { endpointType: 'REST', endpoint: resourceMeta.output.RootUrl, region, - authorizationType: 'AWS_IAM', + authorizationType: resourceMeta.authorizationType || 'AWS_IAM', }; } else if (resourceMeta.service === 'ElasticContainer' && resourceMeta.apiType === 'REST') { amplifyConfig[categoryName].plugins[pluginName][r] = { diff --git a/packages/amplify-frontend-flutter/lib/amplify-config-helper.js b/packages/amplify-frontend-flutter/lib/amplify-config-helper.js index db112e8bddd..36ee8b32952 100644 --- a/packages/amplify-frontend-flutter/lib/amplify-config-helper.js +++ b/packages/amplify-frontend-flutter/lib/amplify-config-helper.js @@ -76,14 +76,14 @@ function constructApi(metadata, amplifyConfig) { endpointType: 'REST', endpoint: resourceMeta.output.RootUrl, region, - authorizationType: 'AWS_IAM', + authorizationType: resourceMeta.authorizationType || 'AWS_IAM', }; } else if (resourceMeta.service === 'ElasticContainer' && resourceMeta.apiType === 'REST') { amplifyConfig[categoryName].plugins[pluginName][r] = { endpointType: 'REST', endpoint: resourceMeta.output.RootUrl, region, - authorizationType: resourceMeta.restrictAccess ? "AMAZON_COGNITO_USER_POOLS" : "AWS_IAM", + authorizationType: resourceMeta.restrictAccess ? 'AMAZON_COGNITO_USER_POOLS' : 'AWS_IAM', }; } } diff --git a/packages/amplify-frontend-ios/lib/amplify-config-helper.js b/packages/amplify-frontend-ios/lib/amplify-config-helper.js index fd541239fc5..59edc9e233e 100644 --- a/packages/amplify-frontend-ios/lib/amplify-config-helper.js +++ b/packages/amplify-frontend-ios/lib/amplify-config-helper.js @@ -77,14 +77,14 @@ function constructApi(metadata, amplifyConfig) { endpointType: 'REST', endpoint: resourceMeta.output.RootUrl, region, - authorizationType: 'AWS_IAM', + authorizationType: resourceMeta.authorizationType || 'AWS_IAM', }; } else if (resourceMeta.service === 'ElasticContainer' && resourceMeta.apiType === 'REST') { amplifyConfig[categoryName].plugins[pluginName][r] = { endpointType: 'REST', endpoint: resourceMeta.output.RootUrl, region, - authorizationType: resourceMeta.restrictAccess ? "AMAZON_COGNITO_USER_POOLS" : "AWS_IAM", + authorizationType: resourceMeta.restrictAccess ? 'AMAZON_COGNITO_USER_POOLS' : 'AWS_IAM', }; } }