Exchanges an authorization code for an access token and an ID token, following the OIDC standard. Call it from your backend, because it needs the App Secret.
Send parameters as application/x-www-form-urlencoded and authenticate with your App ID and App Secret: HTTP Basic (client_secret_basic, recommended) or form fields (client_secret_post). Public clients without a secret (none) are not supported.
Request Body
string
default:"authorization_code"
required
Must be authorization_code. Refresh tokens are not issued.
string
required
The authorization code received on your redirect URI. Single-use, 5-minute lifetime.
string
required
Must exactly match the redirect URI used in the authorization request.
Response
string
Bearer token for the /userinfo endpoint. Valid for 10 minutes.
string
default:"Bearer"
Always Bearer.
number
Access token lifetime in seconds (600).
string
A signed JWT with authentication context only: sub, iss, aud, iat, exp, nonce, plus hopae_verification (provider_id, connection_id). hopae_loa and hopae_loa_label are present whenever a level is known. acr is present only when the connection determined the level for this verification. Personal data is never in the ID token. Read it from /userinfo.
sub is the verification id, a new value for every verification, not a stable user identifier.
hopae_verification.provider_id and hopae_verification.connection_id identify the connection that ran (catalog ids). They are nested under hopae_verification, not top-level claims. There is no amr claim on v2 tokens.
iss is https://connect.hopae.com. Validate it, and verify aud against your App ID. Keys are at /jwks.
ID tokens are valid for 30 minutes.
Authorizations
Authorization
string
header
required
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
grant_type
enum<string>
required
Must be 'authorization_code'.
Available options:
authorization_code
code
string
required
The authorization code received after a successful verification.
client_id
string
required
Your application's Client ID.
client_secret
string
Your application's Client Secret. Required for confidential clients.
Response
Token exchange successful.
id_token
string
A JWT containing the user's verified claims.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"hConnect","colors":{"primary":"#2563EB","light":"#71717A","dark":"#2563EB"},"logo":{"light":"https://mintcdn.com/hopae-a83466ba/ZQEdy_FTEqcDCNky/logo/hconnect_light.png?fit=max\u0026auto=format\u0026n=ZQEdy_FTEqcDCNky\u0026q=85\u0026s=b55f8449a1816421b47a12dfaf0346ad","dark":"https://mintcdn.com/hopae-a83466ba/ZQEdy_FTEqcDCNky/logo/hconnect_dark.png?fit=max\u0026auto=format\u0026n=ZQEdy_FTEqcDCNky\u0026q=85\u0026s=637f0017e4b0ccc77fd6e28d5b177afe"},"favicon":"https://mintcdn.com/hopae-a83466ba/Ic1oE8rFNW-qnQGv/hopae.svg?fit=max\u0026auto=format\u0026n=Ic1oE8rFNW-qnQGv\u0026q=85\u0026s=eb81cb989e33aeaf7c15a3a8567492ca","api":{"openapi":["v2/openapi.json","v2/openapi-oidc.json"],"playground":{"display":"interactive"},"examples":{"languages":["curl","javascript","python"]},"mdx":{"auth":{"method":"basic"},"server":"https://sandbox.api.hopae.com/connect/v1"}},"navbar":{"primary":{"type":"button","label":"Console","href":"https://console.hopae.com"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"hopae-a83466ba","hasAudioNarration":false,"actualSubdomain":"hopae-a83466ba","customDomains":["docs.hopae.com"],"gitSource":{"type":"github","owner":"hopae-official","repo":"hconnect-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b000b3057be3405cca92641","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Guides","count":52},{"language":"default","tag":"Verification API","count":32},{"language":"default","tag":"Workspace API","count":21},{"language":"default","tag":"Concepts","count":13},{"language":"default","tag":"Reference","count":12},{"language":"default","tag":"OIDC","count":11},{"language":"default","tag":"Verifications","count":11},{"language":"default","tag":"Overview","count":10},{"language":"default","tag":"Apps","count":9},{"language":"default","tag":"REST API","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"workos-onboarding","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":"site-roles","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":"assistant-v5","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":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","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":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"page-tags.css","content":"html:has(#sidebar-content a.bg-primary\\/10 [data-nav-tag=\"Sandbox\"]) #page-title::after{content:\"Sandbox\";display:inline-block;margin-left:0.625rem;padding:0.125rem 0.5rem;border-radius:0.375rem;font-size:0.875rem;font-weight:700;line-height:1.25rem;letter-spacing:normal;vertical-align:middle;color:rgb(var(--primary));background-color:rgb(var(--primary) / 0.1)}html.dark:has(#sidebar-content a.bg-primary\\/10 [data-nav-tag=\"Sandbox\"]) #page-title::after{color:rgb(var(--primary-light));background-color:rgb(var(--primary-light) / 0.1)}"}]}
{"page":{"pagePath":"v2/api-reference/oidc/token","slug":"/v2/api-reference/oidc/token","pageMetadata":{"title":"Exchange Code for Token","sidebarTitle":"Token","description":"Exchange an authorization code for v2 ID and access tokens using your app credentials.","openapi":"POST /token","href":"/v2/api-reference/oidc/token"},"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: \"Exchange an authorization code for v2 ID and access tokens using your app credentials.\"\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`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,ParamField,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Exchanges an authorization code for an access token and an ID token, following the OIDC standard. Call it from your backend, because it needs the App Secret.`}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Send parameters as `,_jsx(_components.code,{children:`application/x-www-form-urlencoded`}),` and authenticate with your App ID and App Secret: HTTP Basic (`,_jsx(_components.code,{children:`client_secret_basic`}),`, recommended) or form fields (`,_jsx(_components.code,{children:`client_secret_post`}),`). Public clients without a secret (`,_jsx(_components.code,{children:`none`}),`) are not supported.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`grant_type`,type:`string`,required:true,default:`authorization_code`,id:`param-grant-type`,children:_jsxs(_components.p,{children:[`Must be `,_jsx(_components.code,{children:`authorization_code`}),`. Refresh tokens are not issued.`]})}),`\n`,_jsx(ParamField,{body:`code`,type:`string`,required:true,id:`param-code`,children:_jsx(_components.p,{children:`The authorization code received on your redirect URI. Single-use, 5-minute lifetime.`})}),`\n`,_jsx(ParamField,{body:`redirect_uri`,type:`string`,required:true,id:`param-redirect-uri`,children:_jsx(_components.p,{children:`Must exactly match the redirect URI used in the authorization request.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`access_token`,type:`string`,id:`param-access-token`,children:_jsxs(_components.p,{children:[`Bearer token for the `,_jsx(_components.code,{children:`/userinfo`}),` endpoint. Valid for 10 minutes.`]})}),`\n`,_jsx(ResponseField,{name:`token_type`,type:`string`,default:`Bearer`,id:`param-token-type`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`Bearer`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`expires_in`,type:`number`,id:`param-expires-in`,children:_jsxs(_components.p,{children:[`Access token lifetime in seconds (`,_jsx(_components.code,{children:`600`}),`).`]})}),`\n`,_jsx(ResponseField,{name:`id_token`,type:`string`,id:`param-id-token`,children:_jsxs(_components.p,{children:[`A signed JWT with authentication context only: `,_jsx(_components.code,{children:`sub`}),`, `,_jsx(_components.code,{children:`iss`}),`, `,_jsx(_components.code,{children:`aud`}),`, `,_jsx(_components.code,{children:`iat`}),`, `,_jsx(_components.code,{children:`exp`}),`, `,_jsx(_components.code,{children:`nonce`}),`, plus `,_jsx(_components.code,{children:`hopae_verification`}),` (`,_jsx(_components.code,{children:`provider_id`}),`, `,_jsx(_components.code,{children:`connection_id`}),`). `,_jsx(_components.code,{children:`hopae_loa`}),` and `,_jsx(_components.code,{children:`hopae_loa_label`}),` are present whenever a level is known. `,_jsx(_components.code,{children:`acr`}),` is present only when the connection determined the level for this verification. Personal data is never in the ID token. Read it from `,_jsx(_components.code,{children:`/userinfo`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`scope`,type:`string`,id:`param-scope`,children:_jsx(_components.p,{children:`The granted scopes.`})}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`id-token-claims`,children:`ID token claims`}),`\n`,_jsx(CodeBlock,{filename:`Decoded id_token payload`,numberOfLines:`14`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sub\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"019bc4f2-8a31-7c5e-9d02-4f7a1b3e60d8\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"iss\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://connect.hopae.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"aud\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"xhdh8a13\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"iat\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1788427192`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"exp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1788428992`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"nonce\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"n-0S6_WzA2Mj\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hopae_loa\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hopae_loa_label\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"high\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hopae_verification\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"provider_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"smart-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"connection_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"smart-id\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`sub`}),` is the verification id, a new value for every verification, not a stable user identifier.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`hopae_verification.provider_id`}),` and `,_jsx(_components.code,{children:`hopae_verification.connection_id`}),` identify the connection that ran (catalog ids). They are nested under `,_jsx(_components.code,{children:`hopae_verification`}),`, not top-level claims. There is no `,_jsx(_components.code,{children:`amr`}),` claim on v2 tokens.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`iss`}),` is `,_jsx(_components.code,{children:`https://connect.hopae.com`}),`. Validate it, and verify `,_jsx(_components.code,{children:`aud`}),` against your App ID. Keys are at `,_jsx(_components.a,{href:`/v2/api-reference/oidc/jwks`,children:_jsx(_components.code,{children:`/jwks`})}),`.`]}),`\n`,_jsx(_components.li,{children:`ID tokens are valid for 30 minutes.`}),`\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":"Exchange Code for Token","sidebarTitle":"Token","description":"Exchange an authorization code for v2 ID and access tokens using your app credentials.","openapi":"POST /token","href":"/v2/api-reference/oidc/token"}}},"mdxSourceWithNoJs":{"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`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Exchanges an authorization code for an access token and an ID token, following the OIDC standard. Call it from your backend, because it needs the App Secret.`}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Send parameters as `,_jsx(_components.code,{children:`application/x-www-form-urlencoded`}),` and authenticate with your App ID and App Secret: HTTP Basic (`,_jsx(_components.code,{children:`client_secret_basic`}),`, recommended) or form fields (`,_jsx(_components.code,{children:`client_secret_post`}),`). Public clients without a secret (`,_jsx(_components.code,{children:`none`}),`) are not supported.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`grant_type`,type:`string`,required:true,default:`authorization_code`,id:`param-grant-type`,children:_jsxs(_components.p,{children:[`Must be `,_jsx(_components.code,{children:`authorization_code`}),`. Refresh tokens are not issued.`]})}),`\n`,_jsx(ParamField,{body:`code`,type:`string`,required:true,id:`param-code`,children:_jsx(_components.p,{children:`The authorization code received on your redirect URI. Single-use, 5-minute lifetime.`})}),`\n`,_jsx(ParamField,{body:`redirect_uri`,type:`string`,required:true,id:`param-redirect-uri`,children:_jsx(_components.p,{children:`Must exactly match the redirect URI used in the authorization request.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`access_token`,type:`string`,id:`param-access-token`,children:_jsxs(_components.p,{children:[`Bearer token for the `,_jsx(_components.code,{children:`/userinfo`}),` endpoint. Valid for 10 minutes.`]})}),`\n`,_jsx(ResponseField,{name:`token_type`,type:`string`,default:`Bearer`,id:`param-token-type`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`Bearer`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`expires_in`,type:`number`,id:`param-expires-in`,children:_jsxs(_components.p,{children:[`Access token lifetime in seconds (`,_jsx(_components.code,{children:`600`}),`).`]})}),`\n`,_jsx(ResponseField,{name:`id_token`,type:`string`,id:`param-id-token`,children:_jsxs(_components.p,{children:[`A signed JWT with authentication context only: `,_jsx(_components.code,{children:`sub`}),`, `,_jsx(_components.code,{children:`iss`}),`, `,_jsx(_components.code,{children:`aud`}),`, `,_jsx(_components.code,{children:`iat`}),`, `,_jsx(_components.code,{children:`exp`}),`, `,_jsx(_components.code,{children:`nonce`}),`, plus `,_jsx(_components.code,{children:`hopae_verification`}),` (`,_jsx(_components.code,{children:`provider_id`}),`, `,_jsx(_components.code,{children:`connection_id`}),`). `,_jsx(_components.code,{children:`hopae_loa`}),` and `,_jsx(_components.code,{children:`hopae_loa_label`}),` are present whenever a level is known. `,_jsx(_components.code,{children:`acr`}),` is present only when the connection determined the level for this verification. Personal data is never in the ID token. Read it from `,_jsx(_components.code,{children:`/userinfo`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`scope`,type:`string`,id:`param-scope`,children:_jsx(_components.p,{children:`The granted scopes.`})}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://connect.hopae.com/v2/token'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --user`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{appId}:{appSecret}'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/x-www-form-urlencoded'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'grant_type=authorization_code\u0026code=SplxlOBeZQQYbYS6WxSbIA\u0026redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback'`})]}),`\n`]})})})}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`7`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"access_token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003copaque access token>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"token_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"expires_in\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`600`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id_token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"scope\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openid hopae\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`id-token-claims`,children:`ID token claims`}),`\n`,_jsx(CodeBlock,{filename:`Decoded id_token payload`,numberOfLines:`14`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sub\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"019bc4f2-8a31-7c5e-9d02-4f7a1b3e60d8\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"iss\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://connect.hopae.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"aud\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"xhdh8a13\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"iat\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1788427192`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"exp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1788428992`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"nonce\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"n-0S6_WzA2Mj\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hopae_loa\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hopae_loa_label\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"high\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hopae_verification\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"provider_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"smart-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"connection_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"smart-id\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`sub`}),` is the verification id, a new value for every verification, not a stable user identifier.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`hopae_verification.provider_id`}),` and `,_jsx(_components.code,{children:`hopae_verification.connection_id`}),` identify the connection that ran (catalog ids). They are nested under `,_jsx(_components.code,{children:`hopae_verification`}),`, not top-level claims. There is no `,_jsx(_components.code,{children:`amr`}),` claim on v2 tokens.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`iss`}),` is `,_jsx(_components.code,{children:`https://connect.hopae.com`}),`. Validate it, and verify `,_jsx(_components.code,{children:`aud`}),` against your App ID. Keys are at `,_jsx(_components.a,{href:`/v2/api-reference/oidc/jwks`,children:_jsx(_components.code,{children:`/jwks`})}),`.`]}),`\n`,_jsx(_components.li,{children:`ID tokens are valid for 30 minutes.`}),`\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":"Exchange Code for Token","sidebarTitle":"Token","description":"Exchange an authorization code for v2 ID and access tokens using your app credentials.","openapi":"POST /token","href":"/v2/api-reference/oidc/token"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"ID token claims","slug":"id-token-claims","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --request\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --url\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'https://connect.hopae.com/v2/token'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --user\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{appId}:{appSecret}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Content-Type: application/x-www-form-urlencoded'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --data\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'grant_type=authorization_code\u0026#x26;code=SplxlOBeZQQYbYS6WxSbIA\u0026#x26;redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"7\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"access_token\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u0026#x3C;opaque access token>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"token_type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Bearer\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"expires_in\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">600\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id_token\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"scope\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"openid hopae\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Exchange Code for Token","description":"Exchange an authorization code for v2 ID and access tokens using your app credentials.","operationId":"exchangeCodeForToken","tags":["Token"],"security":[],"requestBody":"920c7ce8-a856-48d5-a8e3-389753f093b2","responses":{"200":"66304f6e-0e21-4dc2-9266-1d9ef57fb876","400":"c3e6eb14-0379-44ae-81b9-a5195f362bf6","401":"26736c28-c52e-4cdf-8568-8971af9a1249"},"method":"post","type":"path","servers":["a90d0789-7d78-4500-99f7-fc1b3e406fb7"],"path":"/token","baseUrlOptions":["https://sandbox.api.hopae.com/connect"],"title":"Exchange Code for Token","codeSamples":[],"requestExampleLanguages":["bash","javascript","python"],"requiredOnlyExamples":false,"requestExamples":[{"dropdown":false,"language":"shellscript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"shellscript","children":{"type":"code","key":null,"ref":null,"props":{"language":"shellscript","numberOfLines":"5","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#953800","--shiki-dark":"#DCDCAA"},"children":"curl"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --request"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" POST"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --url"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" 'https://connect.hopae.com/v2/token'"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --user"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" '{appId}:{appSecret}'"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --header"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" 'Content-Type: application/x-www-form-urlencoded'"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" --data"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" 'grant_type=authorization_code\u0026code=SplxlOBeZQQYbYS6WxSbIA\u0026redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback'"}}]}},"\n"]}}}},"filename":""}],"requestExampleType":"mdx","responseExamples":[{"dropdown":false,"language":"json","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"json","children":{"type":"code","key":null,"ref":null,"props":{"language":"json","numberOfLines":"7","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"{"}}}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"access_token\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"\u003copaque access token>\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"token_type\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Bearer\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"expires_in\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#B5CEA8"},"children":"600"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"id_token\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"scope\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"openid hopae\""}}]}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"}"}}}},"\n"]}}}},"filename":"Response"}],"responseExampleType":"mdx"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","enum":["authorization_code"],"description":"Must be 'authorization_code'.","isRequired":true,"uniqueKey":"grant_type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"The authorization code received after a successful verification.","isRequired":true,"uniqueKey":"code","typeLabel":"string"},"client_id":{"type":"string","description":"Your application's Client ID.","isRequired":true,"uniqueKey":"client_id","typeLabel":"string"},"client_secret":{"type":"string","description":"Your application's Client Secret. Required for confidential clients.","uniqueKey":"client_secret","typeLabel":"string"}},"required":["grant_type","code","client_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"grant_type":"authorization_code","code":"\u003cstring>","client_id":"\u003cstring>","client_secret":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"66304f6e-0e21-4dc2-9266-1d9ef57fb876":{"description":"Token exchange successful.","content":{"application/json":{"schema":{"type":"object","properties":{"id_token":{"type":"string","description":"A JWT containing the user's verified claims.","uniqueKey":"id_token","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id_token":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"c3e6eb14-0379-44ae-81b9-a5195f362bf6":{"description":"Bad Request - Invalid grant_type or missing parameters.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"26736c28-c52e-4cdf-8568-8971af9a1249":{"description":"Unauthorized - Invalid code or client credentials.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"d5d94c62-353d-4a7f-b0c0-734dda4a4d62":{"Authorization":{"type":"http","scheme":"basic","description":"Basic authentication header of the form `Basic \u003cencoded-value>`, where `\u003cencoded-value>` is the base64-encoded string `username:password`."}}},"servers":{"a90d0789-7d78-4500-99f7-fc1b3e406fb7":{"url":"https://sandbox.api.hopae.com/connect","description":"Sandbox Server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"basic","description":"Basic authentication header of the form `Basic \u003cencoded-value>`, where `\u003cencoded-value>` is the base64-encoded string `username:password`."},"schema":{"title":"Basic Auth","type":"object","description":"Basic authentication header of the form `Basic \u003cencoded-value>`, where `\u003cencoded-value>` is the base64-encoded string `username:password`.","isRequired":true,"properties":{"username":{"type":"string","uniqueKey":"username","isRequired":true,"typeLabel":"string","deprecated":false},"password":{"type":"string","uniqueKey":"password","isRequired":true,"typeLabel":"string","deprecated":false}},"additionalProperties":false,"deprecated":false},"schemeName":"Authorization","name":"Authorization"}],"title":"Authorization"}]},"originalFileLocation":"openapi.json"},"subdomain":"hopae-a83466ba","siteName":"hConnect","title":"Exchange Code for Token - hConnect","navMaps":{"firstHrefInVersion":{"v2":{"href":"/v2/api-reference/oidc/token","matchLevel":0},"v1":{"href":"/api-reference/oidc/token","matchLevel":1}},"firstHrefInLanguage":{}},"lastModified":"2026-10-28T08:03:33.526Z","originalFileLocation":"v2/api-reference/oidc/token.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=\"Exchange an authorization code for v2 ID and access tokens using your app credentials.\">\u003cmeta data-mint-head name=\"application-name\" content=\"hConnect\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hopae-a83466ba/ZlLEDy_twj3SXOqy/_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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hopae-a83466ba/ZlLEDy_twj3SXOqy/_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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Exchange Code for Token - hConnect\">\u003cmeta data-mint-head property=\"og:description\" content=\"Exchange an authorization code for v2 ID and access tokens using your app credentials.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"hConnect\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hopae.com/v2/api-reference/oidc/token\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://hopae-a83466ba.mintlify.site/_mintlify/api/og/v2?division=OIDC\u0026amp;title=Exchange+Code+for+Token\u0026amp;description=Exchange+an+authorization+code+for+v2+ID+and+access+tokens+using+your+app+credentials.\u0026amp;theme=bcfc15a264d2f9d377d575f8\u0026amp;signature=a31cf4febc09ef3d139f7d14f56436deefe04da76bb597006b40219169048199\">\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=\"Exchange Code for Token - hConnect\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Exchange an authorization code for v2 ID and access tokens using your app credentials.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://hopae-a83466ba.mintlify.site/_mintlify/api/og/v2?division=OIDC\u0026amp;title=Exchange+Code+for+Token\u0026amp;description=Exchange+an+authorization+code+for+v2+ID+and+access+tokens+using+your+app+credentials.\u0026amp;theme=bcfc15a264d2f9d377d575f8\u0026amp;signature=a31cf4febc09ef3d139f7d14f56436deefe04da76bb597006b40219169048199\">\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/hopae-a83466ba/ZlLEDy_twj3SXOqy/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"hConnect\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hopae.com/v2/api-reference/oidc/token\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/v2/api-reference/oidc/token.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hopae.com/#organization\",\"name\":\"hConnect\",\"url\":\"https://docs.hopae.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/hopae-a83466ba/ZQEdy_FTEqcDCNky/logo/hconnect_light.png?fit=max\u0026auto=format\u0026n=ZQEdy_FTEqcDCNky\u0026q=85\u0026s=b55f8449a1816421b47a12dfaf0346ad\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hopae.com#website\",\"name\":\"hConnect\",\"url\":\"https://docs.hopae.com\",\"publisher\":{\"@id\":\"https://docs.hopae.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hopae.com/v2/api-reference/oidc/token#webpage\",\"url\":\"https://docs.hopae.com/v2/api-reference/oidc/token\",\"name\":\"Exchange Code for Token\",\"description\":\"Exchange an authorization code for v2 ID and access tokens using your app credentials.\",\"dateModified\":\"2026-10-28T08:03:33.526Z\",\"isPartOf\":{\"@id\":\"https://docs.hopae.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hopae.com/v2/api-reference/oidc/token#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hopae.com/v2/api-reference/oidc/token#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"OIDC\",\"item\":\"https://docs.hopae.com/v2/api-reference/oidc/base-url\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exchange Code for Token\",\"item\":\"https://docs.hopae.com/v2/api-reference/oidc/token\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.hopae.com/v2/api-reference/oidc/token#apireference\",\"headline\":\"Exchange Code for Token\",\"name\":\"Exchange Code for Token\",\"description\":\"Exchange an authorization code for v2 ID and access tokens using your app credentials.\",\"url\":\"https://docs.hopae.com/v2/api-reference/oidc/token\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hopae.com/v2/api-reference/oidc/token#webpage\"},\"dateModified\":\"2026-10-28T08:03:33.526Z\",\"publisher\":{\"@id\":\"https://docs.hopae.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hopae.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"hConnect\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"hConnect\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/v2/api-reference/oidc/token.md","siteName":"hConnect","nav":{"global":null,"versions":[{"version":"v2","default":true,"hidden":false,"tabs":[{"tab":"Guides","icon":"book-open","pages":[{"title":"Guides","href":"/v2/guides/getting-started/introduction"}]},{"tab":"Verification API","icon":"square-terminal","groups":[{"group":"Overview","pages":[{"title":"API Overview","sidebarTitle":"Introduction","href":"/v2/api-reference/introduction"},{"title":"Authentication","href":"/v2/api-reference/authentication"},{"title":"Error Code Reference","sidebarTitle":"Error Codes","href":"/v2/api-reference/error-codes"}]},{"group":"OIDC","pages":[{"title":"Base URL","href":"/v2/api-reference/oidc/base-url"},{"title":"Discovery Document","openapi":"GET /.well-known/openid-configuration","href":"/v2/api-reference/oidc/well-known"},{"title":"Start Authorization","openapi":"GET /auth","description":"Initiates the OIDC Authorization Code flow. Front-channel redirect. No Authorization header.","href":"/v2/api-reference/oidc/auth"},{"title":"Exchange Code for Token","sidebarTitle":"Token","openapi":"POST /token","href":"/v2/api-reference/oidc/token"},{"title":"UserInfo","openapi":"GET /userinfo","description":"Returns the verified claims and match outcome, and on request the provenance and missing claims. Requires a valid Bearer access token.","href":"/v2/api-reference/oidc/userinfo"},{"title":"JWKS","openapi":"GET /jwks","href":"/v2/api-reference/oidc/jwks"}]},{"group":"Verifications","pages":[{"title":"Base URL","href":"/v2/api-reference/verifications/base-url"},{"title":"Get Connections","openapi":"GET /connections","href":"/v2/api-reference/verifications/get-connections"},{"title":"Create Verification","openapi":"POST /verifications","href":"/v2/api-reference/verifications/create-verification"},{"title":"Get Verification Status","openapi":"GET /verifications/{verificationId}","href":"/v2/api-reference/verifications/get-verification"},{"title":"Get Verification UserInfo","openapi":"GET /verifications/{verificationId}/userinfo","href":"/v2/api-reference/verifications/get-verification-userinfo"},{"title":"Cancel Verification","openapi":"DELETE /verifications/{verificationId}","href":"/v2/api-reference/verifications/cancel-verification"},{"title":"User Input","sidebarTitle":"User Input","href":"/v2/api-reference/verifications/user-input"}]},{"group":"Provider-specific","pages":[{"title":"List iDIN Banks","openapi":"GET /providers/idin/banks","href":"/v2/api-reference/provider-specific/idin/list-banks"}]}]},{"tab":"Workspace API","icon":"square-terminal","pages":[{"title":"Workspace API","href":"/v2/api-reference/workspace/introduction"}]}]},{"version":"v1","default":false,"pages":[{"title":"v1","href":"/api-reference/oidc/token"}]}]},"basePath":"","title":"Exchange Code for Token - hConnect","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","CodeSnippet-D_HwgQO_.js","getApiPlaygroundDisplay-CmCoerhe.js","Page-CVJ-f_k1.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}