Securely authenticate API requests and protect your team’s data
What is Access Control?
Access Control in Forge ensures that only authorized applications can interact with your team’s entities. This is achieved through Basic Authentication, where you use a secret key to authenticate your API requests. Proper implementation of access control is essential to protect your team’s data and prevent unauthorized modifications.
Creating Secrets for API Access
To authenticate with Forge, you need to create a secret key and use it in your server-side application. Follow these steps to set up your secret:
Navigate to the Secrets Page:
Go to the API Keys page in Forge.
Generate a new secret for your team. This secret acts as the password for API requests.
Store the Secret Securely:
Save the generated secret in a secure environment variable, such as process.env.FORGE_SECRET.
Avoid storing secrets in your source code to prevent accidental exposure.
Obtain Your Team ID:
Your teamId (used as the username in authentication) is available in your team’s settings.
Implementing Access Control in Your Application
Example Integration
Use your teamId and secret in a server-side application to authenticate API requests:
Environment Variables
Store your credentials securely in environment variables:
Secrets must never be exposed in client-side code (e.g., in a browser or mobile app). If exposed, anyone could use them to access your team’s data and modify its entities.
Restrict Access:
Store secrets in a secure location, such as environment variables or a secret management system (e.g., AWS Secrets Manager, HashiCorp Vault).
Rotate Secrets Regularly:
Update your secrets periodically or when you suspect they may have been exposed. Use the Secrets page to rotate keys.
Use HTTPS:
Always send API requests over HTTPS to encrypt the credentials during transmission.
By keeping secrets secure and using them exclusively in server-side
applications, you protect your team’s entities from unauthorized access or
modification.
Why Access Control Matters
Implementing proper access control ensures that:
Your team’s data is secure from unauthorized access.
Only trusted server-side applications can make changes to your entities.
You maintain full control over who can interact with your game resources.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Forge","colors":{"primary":"#7c3aed","light":"#7c3aed","dark":"#09090b"},"favicon":"/favicon.svg","logo":{"light":"https://mintcdn.com/forge/6FDauhoreGw-hoqJ/logo/light.svg?fit=max\u0026auto=format\u0026n=6FDauhoreGw-hoqJ\u0026q=85\u0026s=a8fc778c37027b402369ae34eefa2302","dark":"https://mintcdn.com/forge/6FDauhoreGw-hoqJ/logo/dark.svg?fit=max\u0026auto=format\u0026n=6FDauhoreGw-hoqJ\u0026q=85\u0026s=3241213043f0c1de2092feee9939c93b"},"appearance":{"default":"dark","strict":true},"navbar":{"links":[{"label":"Support","href":"mailto:support@forge-games.xyz"}],"primary":{"type":"button","label":"Get Started","href":"https://forgegames.org"}},"footer":{"socials":{"github":"https://github.com/buildwithforge","linkedin":"https://www.linkedin.com/company/forgegames"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"forge","hasAudioNarration":false,"actualSubdomain":"forge","customDomains":["docs.forgegames.org"],"gitSource":{"type":"github","owner":"benox3","repo":"forge","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae92111e25383f1c0a5ef55:success","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"API Reference","count":37},{"language":"default","tag":"Documentation","count":11},{"language":"default","tag":"templates","count":6},{"language":"default","tag":"items","count":5},{"language":"default","tag":"Essentials","count":4},{"language":"default","tag":"Integration","count":4},{"language":"default","tag":"attributes","count":4},{"language":"default","tag":"classifiers","count":4},{"language":"default","tag":"item-instances","count":4},{"language":"default","tag":"spaces","count":4}]},"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":"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":"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":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navbar-transition img{height:40px}"}]}
{"page":{"pagePath":"integration/access-control","slug":"/integration/access-control","pageMetadata":{"title":"Access Control","description":"Securely authenticate API requests and protect your team's data","icon":"lock","href":"/integration/access-control","hidden":false},"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: \"Securely authenticate API requests and protect your team’s data\"\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`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`what-is-access-control`,children:`What is Access Control?`}),`\n`,_jsxs(_components.p,{children:[`Access Control in Forge ensures that only authorized applications can interact with your team’s entities. This is achieved through `,_jsx(_components.strong,{children:`Basic Authentication`}),`, where you use a secret key to authenticate your API requests. Proper implementation of access control is essential to protect your team’s data and prevent unauthorized modifications.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`creating-secrets-for-api-access`,children:`Creating Secrets for API Access`}),`\n`,_jsxs(_components.p,{children:[`To authenticate with Forge, you need to create a `,_jsx(_components.strong,{children:`secret key`}),` and use it in your server-side application. Follow these steps to set up your secret:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Navigate to the Secrets Page`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Go to the API Keys page in Forge.`}),`\n`,_jsx(_components.li,{children:`Generate a new secret for your team. This secret acts as the password for API requests.`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Store the Secret Securely`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Save the generated secret in a secure environment variable, such as `,_jsx(_components.code,{children:`process.env.FORGE_SECRET`}),`.`]}),`\n`,_jsx(_components.li,{children:`Avoid storing secrets in your source code to prevent accidental exposure.`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Obtain Your Team ID`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Your `,_jsx(_components.code,{children:`teamId`}),` (used as the username in authentication) is available in your team’s settings.`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`implementing-access-control-in-your-application`,children:`Implementing Access Control in Your Application`}),`\n`,_jsx(Heading,{level:`3`,id:`example-integration`,children:`Example Integration`}),`\n`,_jsxs(_components.p,{children:[`Use your `,_jsx(_components.code,{children:`teamId`}),` and secret in a server-side application to authenticate API requests:`]}),`\n`,_jsx(Heading,{level:`4`,id:`environment-variables`,children:`Environment Variables`}),`\n`,_jsx(_components.p,{children:`Store your credentials securely in environment variables:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`FORGE_TEAM_ID=your_team_id`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`FORGE_SECRET=your_secret_key`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`4`,id:`authentication-header`,children:`Authentication Header`}),`\n`,_jsxs(_components.p,{children:[`Generate the `,_jsx(_components.code,{children:`Authorization`}),` header by combining the `,_jsx(_components.code,{children:`teamId`}),` and secret as `,_jsx(_components.code,{children:`teamId:secret`}),`, then base64 encode it.`]}),`\n`,_jsx(_components.p,{children:`Example in Node.js:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` teamId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`FORGE_TEAM_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` secret`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`FORGE_SECRET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` authHeader`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Basic \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Buffer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`teamId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`secret`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"base64\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Example API request using Axios`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` axios`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"axios\"`}),_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\":`#9CDCFE`},children:`axios`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.forgegames.org/teams/team123/items\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Authorization:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` authHeader`}),_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`,_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:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`then`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_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`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`important-security-considerations`,children:`Important Security Considerations`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Always Use Server-Side Applications`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Secrets must never be exposed in client-side code (e.g., in a browser or mobile app). If exposed, anyone could use them to access your team’s data and modify its entities.`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Restrict Access`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Store secrets in a secure location, such as environment variables or a secret management system (e.g., AWS Secrets Manager, HashiCorp Vault).`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Rotate Secrets Regularly`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Update your secrets periodically or when you suspect they may have been exposed. Use the `,_jsx(_components.a,{href:`/secrets`,children:`Secrets page`}),` to rotate keys.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Use HTTPS`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Always send API requests over HTTPS to encrypt the credentials during transmission.`}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`By keeping secrets secure and using them exclusively in server-side\napplications, you protect your team’s entities from unauthorized access or\nmodification.`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`why-access-control-matters`,children:`Why Access Control Matters`}),`\n`,_jsx(_components.p,{children:`Implementing proper access control ensures that:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Your team’s data is secure from unauthorized access.`}),`\n`,_jsx(_components.li,{children:`Only trusted server-side applications can make changes to your entities.`}),`\n`,_jsx(_components.li,{children:`You maintain full control over who can interact with your game resources.`}),`\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":"Access Control","description":"Securely authenticate API requests and protect your team's data","icon":"lock","href":"/integration/access-control","hidden":false}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What is Access Control?","slug":"what-is-access-control","depth":2,"children":[]},{"title":"Creating Secrets for API Access","slug":"creating-secrets-for-api-access","depth":2,"children":[]},{"title":"Implementing Access Control in Your Application","slug":"implementing-access-control-in-your-application","depth":2,"children":[{"title":"Example Integration","slug":"example-integration","depth":3,"children":[]},{"title":"Environment Variables","slug":"environment-variables","depth":4,"children":[]},{"title":"Authentication Header","slug":"authentication-header","depth":4,"children":[]}]},{"title":"Important Security Considerations","slug":"important-security-considerations","depth":2,"children":[]},{"title":"Why Access Control Matters","slug":"why-access-control-matters","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"forge","siteName":"Forge","title":"Access Control - Forge","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T02:46:58.713Z","originalFileLocation":"integration/access-control.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";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=\"dark\"}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=\"Securely authenticate API requests and protect your team\u0026#x27;s data\">\u003cmeta data-mint-head name=\"application-name\" content=\"Forge\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/forge/Vkorqzj0THNL-o9r/_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/forge/Vkorqzj0THNL-o9r/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/forge/Vkorqzj0THNL-o9r/_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/forge/Vkorqzj0THNL-o9r/_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/forge/Vkorqzj0THNL-o9r/_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/forge/Vkorqzj0THNL-o9r/_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/forge/Vkorqzj0THNL-o9r/_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/forge/Vkorqzj0THNL-o9r/_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/forge/Vkorqzj0THNL-o9r/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Access Control - Forge\">\u003cmeta data-mint-head property=\"og:description\" content=\"Securely authenticate API requests and protect your team\u0026#x27;s data\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Forge\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.forgegames.org/integration/access-control\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://forge.mintlify.site/_mintlify/api/og/v2?division=Integration\u0026amp;title=Access+Control\u0026amp;description=Securely+authenticate+API+requests+and+protect+your+team%27s+data\u0026amp;theme=4314bde5e59a56005ffd9a16\u0026amp;signature=e65879322171796e21a17f48d129a839008a16630e1eaf3451261432988bf4e6\">\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=\"Access Control - Forge\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Securely authenticate API requests and protect your team\u0026#x27;s data\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://forge.mintlify.site/_mintlify/api/og/v2?division=Integration\u0026amp;title=Access+Control\u0026amp;description=Securely+authenticate+API+requests+and+protect+your+team%27s+data\u0026amp;theme=4314bde5e59a56005ffd9a16\u0026amp;signature=e65879322171796e21a17f48d129a839008a16630e1eaf3451261432988bf4e6\">\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/forge/Vkorqzj0THNL-o9r/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Forge\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7c3aed\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.forgegames.org/integration/access-control\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integration/access-control.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.forgegames.org/#organization\",\"name\":\"Forge\",\"url\":\"https://docs.forgegames.org\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/forge/6FDauhoreGw-hoqJ/logo/light.svg?fit=max\u0026auto=format\u0026n=6FDauhoreGw-hoqJ\u0026q=85\u0026s=a8fc778c37027b402369ae34eefa2302\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.forgegames.org#website\",\"name\":\"Forge\",\"url\":\"https://docs.forgegames.org\",\"publisher\":{\"@id\":\"https://docs.forgegames.org/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.forgegames.org/integration/access-control#webpage\",\"url\":\"https://docs.forgegames.org/integration/access-control\",\"name\":\"Access Control\",\"description\":\"Securely authenticate API requests and protect your team's data\",\"dateModified\":\"2026-01-07T02:46:58.713Z\",\"isPartOf\":{\"@id\":\"https://docs.forgegames.org#website\"},\"breadcrumb\":{\"@id\":\"https://docs.forgegames.org/integration/access-control#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.forgegames.org/integration/access-control#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Forge\",\"item\":\"https://docs.forgegames.org\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Access Control\",\"item\":\"https://docs.forgegames.org/integration/access-control\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.forgegames.org/integration/access-control#article\",\"headline\":\"Access Control\",\"name\":\"Access Control\",\"description\":\"Securely authenticate API requests and protect your team's data\",\"url\":\"https://docs.forgegames.org/integration/access-control\",\"mainEntityOfPage\":{\"@id\":\"https://docs.forgegames.org/integration/access-control#webpage\"},\"dateModified\":\"2026-01-07T02:46:58.713Z\",\"publisher\":{\"@id\":\"https://docs.forgegames.org/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.forgegames.org#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Forge\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Forge\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/integration/access-control.md","siteName":"Forge","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Build Your Game's Inventory System","href":"/build-inventory-systems"}]},{"group":"Essentials","pages":[{"title":"Classifiers","icon":"layer-group","href":"/essentials/classifiers"},{"title":"Attributes","icon":"sliders","href":"/essentials/attributes"},{"title":"Items","icon":"sword","href":"/essentials/items"},{"title":"Spaces","description":" Spaces in Forge serve as structured storage areas where item instances are stored and managed within your game. Each space defines a specific area designated for organizing items based on their usage or category. This document outlines how spaces function as storage compartments and their role in facilitating item management. ","icon":"box-open","href":"/essentials/spaces"}]},{"group":"Integration","pages":[{"title":"Access Control","icon":"lock","href":"/integration/access-control"},{"title":"Item Instances","description":"Create and manage individual occurrences of items with unique properties","icon":"cube","href":"/integration/item-instances"},{"title":"Rolling","icon":"dice","href":"/integration/rolling"},{"title":"User Management","icon":"users","href":"/integration/user-management"}]},{"group":"Guides","pages":[{"title":"Inventory Systems","icon":"box","href":"/guides/inventory-systems"}]}]},{"anchor":"API Reference","icon":"square-terminal","pages":[{"title":"API Reference","href":"/api-reference/attributes/list-attributes"}]}]},"basePath":"","title":"Access Control - Forge","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}