Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode
This guide walks through configuring Amazon Cognito as an OIDC identity provider for Modelcode SSO. Cognito User Pools natively support OpenID Connect.
Prerequisites
Admin access to your Modelcode organization, signed in with email and password — the SSO settings page is not available to users who signed in with a social provider (GitHub, GitLab, Microsoft)
An AWS account with access to Amazon Cognito
Privileges to create and edit app clients and policies in your Cognito User Pool
Step 1: Create an App Client in Cognito
In the AWS Console, navigate to Amazon Cognito → User Pools
Select your User Pool (or create a new one)
Go to App integration → App clients and analytics
Click Create app client
Configure the app client:
Field
Value
App type
Confidential client
App client name
Modelcode SSO (or any descriptive name)
Generate a client secret
Yes
Under Hosted UI settings, configure:
Field
Value
Allowed callback URLs
The Callback URL from the Modelcode SSO settings page (displayed when you select OpenID Connect)
Allowed sign-out URLs
https://morph.modelcode.ai (optional)
Identity providers
Select the providers enabled in your User Pool
OAuth 2.0 grant types
Authorization code grant
OpenID Connect scopes
openid, email, profile
The Callback URL is displayed on the Modelcode SSO settings page when you select OpenID Connect.
Click Create app client
After creation, note the Client ID and Client Secret from the app client details
Modelcode validates the configuration by fetching the Cognito OIDC discovery document.
Step 4: Update the Callback URL in Cognito
After configuring, verify the Callback URL displayed on the Modelcode SSO settings page matches the Allowed callback URL in your Cognito app client. Update the Cognito app client if needed.
Step 5: Invite Users and Share the Portal Link
Before users can sign in via SSO, they must be invited to Modelcode:
In Modelcode, go to the Members page and invite each user who needs SSO access
Copy the Portal Link from the SSO settings page and share it with your team:
When team members visit this link, they are redirected to the Cognito hosted UI (or your custom UI domain) to sign in, then returned to Modelcode with an active session.
Troubleshooting
”Verification failed” during setup
Confirm the Issuer URL follows the format https://cognito-idp.<region>.amazonaws.com/<user-pool-id>
Verify the User Pool ID and region are correct
Access the discovery URL in your browser to confirm it returns a JSON document
Users see “redirect_mismatch” error
The Callback URL in Cognito must exactly match the Callback URL shown in Modelcode — including the protocol, domain, and path
Check for trailing slashes or other differences
Users authenticate but are not recognized in Modelcode
Ensure the user’s email in Cognito matches their Modelcode account email
Verify the email attribute is configured and populated for users in the Cognito User Pool
Confirm the email scope is included in the app client’s allowed scopes
Ensure users are accessing Modelcode through the Portal Link, not the standard login page
Users see the Cognito hosted UI instead of a custom login page
If you’ve configured a custom domain for your Cognito User Pool, it should work automatically with OIDC
The Cognito hosted UI is the default authentication interface when no custom UI is configured
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Modelcode","colors":{"primary":"#069bfa","light":"#3db4ff","dark":"#0070c9"},"logo":{"light":"https://mintcdn.com/modelcodeai/FvveHrl7MJeyooqL/logo/light.svg?fit=max\u0026auto=format\u0026n=FvveHrl7MJeyooqL\u0026q=85\u0026s=16f79135c593bd6abebaf54cceb4767e","dark":"https://mintcdn.com/modelcodeai/FvveHrl7MJeyooqL/logo/dark.svg?fit=max\u0026auto=format\u0026n=FvveHrl7MJeyooqL\u0026q=85\u0026s=3fb838182196b5e8fe22a20c1fecb8bd"},"favicon":"https://mintcdn.com/modelcodeai/gIHFr_f_bIsWGfde/favicon.svg?fit=max\u0026auto=format\u0026n=gIHFr_f_bIsWGfde\u0026q=85\u0026s=3d0e41c956e5e16277317ef7bcaa90a6","navbar":{"links":[{"href":"mailto:support@modelcode.ai","label":"Support"}],"primary":{"type":"button","label":"Get Started","href":"https://modelcode.ai"}},"footer":{"socials":{"github":"https://github.com/Modelcode-ai","linkedin":"https://www.linkedin.com/company/modelcode-ai"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"modelcodeai","hasAudioNarration":false,"actualSubdomain":"modelcodeai","customDomains":["docs.modelcode.ai"],"gitSource":{"type":"github","owner":"modelcode-ai","repo":"morph-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10d0b69ffae5051c40b14b"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6b134028e8026b14a14afbcc","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"Project Setup","count":8},{"language":"default","tag":"Administration","count":7},{"language":"default","tag":"Running Your Migration","count":6},{"language":"default","tag":"Source Control","count":6},{"language":"default","tag":"Single Sign-On","count":5},{"language":"default","tag":"Getting Started","count":4},{"language":"default","tag":"Knowledge and Rules","count":4},{"language":"default","tag":"Code Review","count":4},{"language":"default","tag":"Support","count":4},{"language":"default","tag":"Claude Code Integration","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@modelcode.ai"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"setup/sso/cognito","slug":"/setup/sso/cognito","pageMetadata":{"title":"Amazon Cognito","description":"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode","href":"/setup/sso/cognito"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This guide walks through configuring `,_jsx(_components.strong,{children:`Amazon Cognito`}),` as an OIDC identity provider for Modelcode SSO. Cognito User Pools natively support OpenID Connect.`]}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Admin access to your Modelcode organization, `,_jsx(_components.strong,{children:`signed in with email and password`}),` — the SSO settings page is not available to users who signed in with a social provider (GitHub, GitLab, Microsoft)`]}),`\n`,_jsx(_components.li,{children:`An AWS account with access to Amazon Cognito`}),`\n`,_jsx(_components.li,{children:`Privileges to create and edit app clients and policies in your Cognito User Pool`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-1-create-an-app-client-in-cognito`,children:`Step 1: Create an App Client in Cognito`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`In the AWS Console, navigate to `,_jsx(_components.strong,{children:`Amazon Cognito → User Pools`})]}),`\n`,_jsx(_components.li,{children:`Select your User Pool (or create a new one)`}),`\n`,_jsxs(_components.li,{children:[`Go to `,_jsx(_components.strong,{children:`App integration → App clients and analytics`})]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Create app client`})]}),`\n`,_jsx(_components.li,{children:`Configure the app client:`}),`\n`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`App type`})}),_jsx(_components.td,{children:`Confidential client`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`App client name`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Modelcode SSO`}),` (or any descriptive name)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Generate a client secret`})}),_jsx(_components.td,{children:`Yes`})]})]})]}),`\n`,_jsxs(_components.ol,{start:`6`,children:[`\n`,_jsxs(_components.li,{children:[`Under `,_jsx(_components.strong,{children:`Hosted UI settings`}),`, configure:`]}),`\n`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Allowed callback URLs`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.strong,{children:`Callback URL`}),` from the Modelcode SSO settings page (displayed when you select OpenID Connect)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Allowed sign-out URLs`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`https://morph.modelcode.ai`}),` (optional)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Identity providers`})}),_jsx(_components.td,{children:`Select the providers enabled in your User Pool`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`OAuth 2.0 grant types`})}),_jsx(_components.td,{children:`Authorization code grant`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`OpenID Connect scopes`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`openid`}),`, `,_jsx(_components.code,{children:`email`}),`, `,_jsx(_components.code,{children:`profile`})]})]})]})]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`The Callback URL is displayed on the Modelcode SSO settings page when you select OpenID Connect.`})}),`\n`,_jsxs(_components.ol,{start:`7`,children:[`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Create app client`})]}),`\n`,_jsxs(_components.li,{children:[`After creation, note the `,_jsx(_components.strong,{children:`Client ID`}),` and `,_jsx(_components.strong,{children:`Client Secret`}),` from the app client details`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-2-find-your-cognito-issuer-url`,children:`Step 2: Find Your Cognito Issuer URL`}),`\n`,_jsx(_components.p,{children:`The Cognito Issuer URL follows this format:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://cognito-idp.\u003cregion>.amazonaws.com/\u003cuser-pool-id>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`To find your values:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`In the Cognito console, go to your User Pool`}),`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.strong,{children:`User Pool ID`}),` is displayed on the overview page (e.g., `,_jsx(_components.code,{children:`us-east-1_aBcDeFgHi`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.strong,{children:`Region`}),` is the AWS region where your User Pool is hosted (e.g., `,_jsx(_components.code,{children:`us-east-1`}),`)`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For example, if your User Pool ID is `,_jsx(_components.code,{children:`us-east-1_aBcDeFgHi`}),`, the Issuer URL is:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://cognito-idp.us-east-1.amazonaws.com/us-east-1_aBcDeFgHi`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`You can verify the discovery document is available by visiting:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://cognito-idp.\u003cregion>.amazonaws.com/\u003cuser-pool-id>/.well-known/openid-configuration`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`step-3-configure-oidc-in-modelcode`,children:`Step 3: Configure OIDC in Modelcode`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`In Modelcode, navigate to `,_jsx(_components.strong,{children:`Single Sign-On`}),` in the sidebar`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Setup SSO`}),` (or `,_jsx(_components.strong,{children:`Edit`}),` if updating)`]}),`\n`,_jsxs(_components.li,{children:[`Select `,_jsx(_components.strong,{children:`OpenID Connect`}),` as the protocol`]}),`\n`,_jsx(_components.li,{children:`Enter the following:`}),`\n`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Issuer URL`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://cognito-idp.\u003cregion>.amazonaws.com/\u003cuser-pool-id>`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Client ID`})}),_jsx(_components.td,{children:`The Client ID from your Cognito app client`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Client Secret`})}),_jsx(_components.td,{children:`The Client Secret from your Cognito app client`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Scopes`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`openid email profile`}),` (default)`]})]})]})]}),`\n`,_jsxs(_components.ol,{start:`5`,children:[`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Verify \u0026 Save`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Modelcode validates the configuration by fetching the Cognito OIDC discovery document.`}),`\n`,_jsx(Heading,{level:`2`,id:`step-4-update-the-callback-url-in-cognito`,children:`Step 4: Update the Callback URL in Cognito`}),`\n`,_jsxs(_components.p,{children:[`After configuring, verify the `,_jsx(_components.strong,{children:`Callback URL`}),` displayed on the Modelcode SSO settings page matches the `,_jsx(_components.strong,{children:`Allowed callback URL`}),` in your Cognito app client. Update the Cognito app client if needed.`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-5-invite-users-and-share-the-portal-link`,children:`Step 5: Invite Users and Share the Portal Link`}),`\n`,_jsx(_components.p,{children:`Before users can sign in via SSO, they must be invited to Modelcode:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`In Modelcode, go to the `,_jsx(_components.a,{href:`https://morph.modelcode.ai/user-roles?tab=users`,children:`Members`}),` page and invite each user who needs SSO access`]}),`\n`,_jsxs(_components.li,{children:[`Copy the `,_jsx(_components.strong,{children:`Portal Link`}),` from the SSO settings page and share it with your team:`]}),`\n`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://morph.modelcode.ai/sso-portal/\u003cyour-organization-id>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`When team members visit this link, they are redirected to the Cognito hosted UI (or your custom UI domain) to sign in, then returned to Modelcode with an active session.`}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsx(Heading,{level:`3`,id:`”verification-failed”-during-setup`,children:`”Verification failed” during setup`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Confirm the Issuer URL follows the format `,_jsx(_components.code,{children:`https://cognito-idp.\u003cregion>.amazonaws.com/\u003cuser-pool-id>`})]}),`\n`,_jsx(_components.li,{children:`Verify the User Pool ID and region are correct`}),`\n`,_jsx(_components.li,{children:`Access the discovery URL in your browser to confirm it returns a JSON document`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`users-see-“redirect_mismatch”-error`,children:`Users see “redirect_mismatch” error`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The Callback URL in Cognito must exactly match the Callback URL shown in Modelcode — including the protocol, domain, and path`}),`\n`,_jsx(_components.li,{children:`Check for trailing slashes or other differences`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`users-authenticate-but-are-not-recognized-in-modelcode`,children:`Users authenticate but are not recognized in Modelcode`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Ensure the user’s email in Cognito matches their Modelcode account email`}),`\n`,_jsxs(_components.li,{children:[`Verify the `,_jsx(_components.code,{children:`email`}),` attribute is configured and populated for users in the Cognito User Pool`]}),`\n`,_jsxs(_components.li,{children:[`Confirm the `,_jsx(_components.code,{children:`email`}),` scope is included in the app client’s allowed scopes`]}),`\n`,_jsxs(_components.li,{children:[`Ensure users are accessing Modelcode through the `,_jsx(_components.strong,{children:`Portal Link`}),`, not the standard login page`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`users-see-the-cognito-hosted-ui-instead-of-a-custom-login-page`,children:`Users see the Cognito hosted UI instead of a custom login page`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`If you’ve configured a custom domain for your Cognito User Pool, it should work automatically with OIDC`}),`\n`,_jsx(_components.li,{children:`The Cognito hosted UI is the default authentication interface when no custom UI is configured`}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Amazon Cognito","description":"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode","href":"/setup/sso/cognito"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"Step 1: Create an App Client in Cognito","slug":"step-1-create-an-app-client-in-cognito","depth":2,"children":[]},{"title":"Step 2: Find Your Cognito Issuer URL","slug":"step-2-find-your-cognito-issuer-url","depth":2,"children":[]},{"title":"Step 3: Configure OIDC in Modelcode","slug":"step-3-configure-oidc-in-modelcode","depth":2,"children":[]},{"title":"Step 4: Update the Callback URL in Cognito","slug":"step-4-update-the-callback-url-in-cognito","depth":2,"children":[]},{"title":"Step 5: Invite Users and Share the Portal Link","slug":"step-5-invite-users-and-share-the-portal-link","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[{"title":"”Verification failed” during setup","slug":"”verification-failed”-during-setup","depth":3,"children":[]},{"title":"Users see “redirect_mismatch” error","slug":"users-see-“redirect_mismatch”-error","depth":3,"children":[]},{"title":"Users authenticate but are not recognized in Modelcode","slug":"users-authenticate-but-are-not-recognized-in-modelcode","depth":3,"children":[]},{"title":"Users see the Cognito hosted UI instead of a custom login page","slug":"users-see-the-cognito-hosted-ui-instead-of-a-custom-login-page","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"modelcodeai","siteName":"Modelcode","title":"Amazon Cognito - Modelcode","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-12-04T22:35:27.080Z","originalFileLocation":"setup/sso/cognito.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode\">\u003cmeta data-mint-head name=\"application-name\" content=\"Modelcode\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Amazon Cognito - Modelcode\">\u003cmeta data-mint-head property=\"og:description\" content=\"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Modelcode\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.modelcode.ai/setup/sso/cognito\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://modelcodeai.mintlify.site/_mintlify/api/og/v2?division=Single+Sign-On\u0026amp;title=Amazon+Cognito\u0026amp;description=Configure+Amazon+Cognito+as+an+OpenID+Connect+identity+provider+for+Modelcode\u0026amp;theme=07f614b49cd68aaef23f5a56\u0026amp;signature=5cc76425fa9803e35b30d2f3f59710aceccde941f7f9b0ea23386e1bd6476a65\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Amazon Cognito - Modelcode\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://modelcodeai.mintlify.site/_mintlify/api/og/v2?division=Single+Sign-On\u0026amp;title=Amazon+Cognito\u0026amp;description=Configure+Amazon+Cognito+as+an+OpenID+Connect+identity+provider+for+Modelcode\u0026amp;theme=07f614b49cd68aaef23f5a56\u0026amp;signature=5cc76425fa9803e35b30d2f3f59710aceccde941f7f9b0ea23386e1bd6476a65\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/modelcodeai/H1hkunG9Mcy8ETVM/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Modelcode\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#069bfa\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.modelcode.ai/setup/sso/cognito\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/setup/sso/cognito.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.modelcode.ai/#organization\",\"name\":\"Modelcode\",\"url\":\"https://docs.modelcode.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/modelcodeai/FvveHrl7MJeyooqL/logo/light.svg?fit=max\u0026auto=format\u0026n=FvveHrl7MJeyooqL\u0026q=85\u0026s=16f79135c593bd6abebaf54cceb4767e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.modelcode.ai#website\",\"name\":\"Modelcode\",\"url\":\"https://docs.modelcode.ai\",\"publisher\":{\"@id\":\"https://docs.modelcode.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.modelcode.ai/setup/sso/cognito#webpage\",\"url\":\"https://docs.modelcode.ai/setup/sso/cognito\",\"name\":\"Amazon Cognito\",\"description\":\"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode\",\"dateModified\":\"2026-12-04T22:35:27.080Z\",\"isPartOf\":{\"@id\":\"https://docs.modelcode.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.modelcode.ai/setup/sso/cognito#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.modelcode.ai/setup/sso/cognito#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Administration\",\"item\":\"https://docs.modelcode.ai/setup/build-environment/daemon-administration\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Single Sign-On\",\"item\":\"https://docs.modelcode.ai/setup/sso/single-sign-on\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Amazon Cognito\",\"item\":\"https://docs.modelcode.ai/setup/sso/cognito\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.modelcode.ai/setup/sso/cognito#article\",\"headline\":\"Amazon Cognito\",\"name\":\"Amazon Cognito\",\"description\":\"Configure Amazon Cognito as an OpenID Connect identity provider for Modelcode\",\"url\":\"https://docs.modelcode.ai/setup/sso/cognito\",\"mainEntityOfPage\":{\"@id\":\"https://docs.modelcode.ai/setup/sso/cognito#webpage\"},\"dateModified\":\"2026-12-04T22:35:27.080Z\",\"publisher\":{\"@id\":\"https://docs.modelcode.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.modelcode.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Modelcode\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Modelcode\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/setup/sso/cognito.md","siteName":"Modelcode","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Core Concepts","href":"/core-concepts"},{"title":"Supported Architectures","href":"/setup/supported-architectures"}]},{"group":"Source Control","pages":[{"title":"Source Control","sidebarTitle":"Overview","href":"/setup/source-control"},{"title":"GitHub Integration","sidebarTitle":"GitHub","href":"/setup/github-integration"},{"title":"GitLab Integration","sidebarTitle":"GitLab","href":"/setup/gitlab-integration"},{"title":"GitLab Self-Managed Integration","sidebarTitle":"GitLab Self-Managed","href":"/setup/gitlab-self-managed"},{"title":"Azure DevOps Integration","sidebarTitle":"Azure DevOps","href":"/setup/azure-devops-integration"},{"title":"Prerequisite Checks","sidebarTitle":"Prerequisite Checks","href":"/setup/prerequisite-checks"}]},{"group":"Build Environment","pages":[{"title":"Modelcode Hosted","href":"/setup/build-environment/modelcode-hosted"},{"title":"Self-Hosted Daemon","href":"/setup/build-environment/self-hosted-daemon"},{"title":"Switching Environments","href":"/setup/build-environment/switching-environment"}]},{"group":"Project Setup","pages":[{"title":"Modernization Goals","href":"/setup/modernization-goals"},{"title":"Project Spec","href":"/setup/reviewing-project-spec"},{"title":"Validation Level","href":"/setup/validation-level"},{"title":"Lifecycle Strategy","href":"/setup/lifecycle-strategy"},{"title":"Lifecycle Setup","href":"/setup/lifecycle-setup"},{"title":"Acceptance Criteria","href":"/setup/acceptance-criteria"},{"title":"Git Strategy and Branches","sidebarTitle":"Git Strategy","href":"/setup/git-strategy"},{"title":"Collaborative Onboarding","href":"/setup/collaborative-onboarding"}]},{"group":"Running Your Migration","pages":[{"title":"Roadmap","href":"/migration/roadmap"},{"title":"Milestones","href":"/migration/milestones"},{"title":"When a Run Needs Your Help","href":"/migration/run-needs-help"},{"title":"Editing Milestones","href":"/customization/editing-milestones"},{"title":"Ad-Hoc Milestones","href":"/migration/adhoc-milestones"},{"title":"Validation Hub","href":"/migration/validation-hub"}]},{"group":"Code Review","pages":[{"title":"Pull Requests","href":"/migration/pull-requests"},{"title":"Code Review Chat","href":"/migration/code-review-chat"},{"title":"Review Assignments","href":"/migration/review-issue-assignment"},{"title":"PR Agent","href":"/migration/pr-agent"}]},{"group":"Claude Code Integration","pages":[{"title":"Overview","href":"/claude-code/overview"},{"title":"Set Up Claude Code","href":"/claude-code/setup"},{"title":"Use Cases","href":"/claude-code/use-cases"}]},{"group":"Knowledge and Rules","pages":[{"title":"Project Knowledge","href":"/customization/project-knowledge"},{"title":"Comments","href":"/customization/commenting"},{"title":"Organizational Knowledge","href":"/customization/organizational-knowledge"},{"title":"Rules","href":"/customization/rules"}]},{"group":"Administration","pages":[{"title":"Daemon Administration","href":"/setup/build-environment/daemon-administration"},{"title":"Billing and Credits","href":"/support/billing-and-credits"},{"group":"Single Sign-On","pages":[{"title":"Single Sign-On","href":"/setup/sso/single-sign-on"},{"title":"OpenID Connect (OIDC)","href":"/setup/sso/oidc"},{"title":"SAML 2.0","href":"/setup/sso/saml"},{"title":"Okta","description":"Configure Okta as an identity provider for Modelcode using SAML 2.0 or OpenID Connect","href":"/setup/sso/okta"},{"title":"Amazon Cognito","href":"/setup/sso/cognito"}]}]},{"group":"Support","pages":[{"title":"Troubleshooting","description":"Solutions to common issues","href":"/support/troubleshooting"},{"title":"FAQ","href":"/support/faq"},{"title":"Videos","href":"/support/videos"},{"title":"What's New","href":"/support/whats-new"}]}]},"basePath":"","title":"Amazon Cognito - Modelcode","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":[],"chunks":[]}