{"record":{"id":"dcc2e475e8ee434c","repo":"anomalyco/sst","slug":"invalid-provider-type-args-type","errorCode":null,"errorMessage":"Invalid provider type: ${args.type}","messagePattern":"Invalid provider type: (.+?)","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/cognito-identity-provider.ts","lineNumber":52,"sourceCode":"\n    const providerType = normalizeProviderType();\n    const identityProvider = createIdentityProvider();\n\n    this.identityProvider = identityProvider;\n\n    function normalizeProviderType() {\n      const type = output(args.type).apply(\n        (type) =>\n          ({\n            saml: \"SAML\",\n            oidc: \"OIDC\",\n            facebook: \"Facebook\",\n            google: \"Google\",\n            amazon: \"LoginWithAmazon\",\n            apple: \"SignInWithApple\",\n          })[type],\n      );\n      if (!type) throw new VisibleError(`Invalid provider type: ${args.type}`);\n      return type;\n    }\n\n    function createIdentityProvider() {\n      return new cognito.IdentityProvider(\n        ...transform(\n          args.transform?.identityProvider,\n          `${name}IdentityProvider`,\n          {\n            userPoolId: args.userPool,\n            providerName: name,\n            providerType,\n            providerDetails: args.details,\n            attributeMapping: args.attributes,\n          },\n          { parent },\n        ),\n      );","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/cognito-identity-provider.ts#L34-L70","documentation":"Cognito Identity Provider supports a fixed set of provider types (Google, Facebook, LoginWithAmazon, SignInWithApple, plus OIDC/SAML). SST maps its args.provider string to the AWS type; if the mapping yields nothing the value was misspelled or unsupported, so it throws.","triggerScenarios":"new sst.aws.CognitoIdentityProvider('X', { provider: 'github', userPool }) where args.provider doesn't match a known key in normalizeProviderType.","commonSituations":"Typos ('Google' vs 'google', 'apple' vs 'signInWithApple'); attempting GitHub OAuth (not natively supported by Cognito — needs OIDC); copying provider names from other platforms.","solutions":["Use one of the supported provider values: 'google', 'facebook', 'amazon', or 'apple'.","Check spelling/casing of args.provider against the SST CognitoIdentityProvider docs.","For unsupported IdPs like GitHub, set up a generic OIDC provider in Cognito instead of this component."],"exampleFix":"// before\nnew sst.aws.CognitoIdentityProvider('Google', { userPool, provider: 'Google' });\n// after\nnew sst.aws.CognitoIdentityProvider('Google', { userPool, provider: 'google', ... });","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['google', 'facebook', 'amazon', 'apple'];\nfunction validateProvider(provider) {\n  if (!SUPPORTED.includes(provider))\n    throw new Error(`Unsupported provider: ${provider}. Use one of ${SUPPORTED.join(', ')}`);\n}\nvalidateProvider(args.provider);","typeGuard":"const isSupportedProvider = (p) => ['google','facebook','amazon','apple'].includes(p);","tryCatchPattern":null,"preventionTips":["Use lowercase literal provider names from the SST docs.","For GitHub/other IdPs, use Cognito's OIDC provider path instead.","Centralize the provider name in a constant with a union type."],"tags":["aws","cognito","oauth","config-validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}