Integrations
Contentful
Set up Contentful OAuth for headless CMS content management
Overview
Section titled “Overview”Connect the application’s users to Contentful for headless CMS content management, content delivery, and space administration.
| Property | Value |
|---|---|
| Provider ID | contentful |
| Category | Developer Tools |
| PKCE | Supported |
| Token refresh | Automatic |
| Redirect URI | Shown in Developer Portal |
GraphQL policy coverage
Section titled “GraphQL policy coverage”The GraphQL Content API is read-only and generated per space. Alter classifies GET and POST on /content/v1/spaces/{space_id} and /content/v1/spaces/{space_id}/environments/{environment_id} as aggregate read operations on graphql.contentful.com and graphql.eu.contentful.com. Policies can target the route and space/environment; individual content-model root fields are not separately classified.
Newly created rules or rules whose body changes use these read families: a read deny applies, while a delete or write deny permits the read. Pre-existing rules retain their prior unclassified-route decisions, including fail-closed family denies and read allowlists. Identical rule-body submissions preserve the prior meaning.
Rules that name Contentful REST operation IDs reach the GraphQL routes as follows:
- REST read rules cover GraphQL reads. A deny or approval rule naming a
readREST operation (for examplecda/entries/list,cda/entries/getorcma/spaces/get) also applies to all four GraphQL routes, because a GraphQL query can read the same content. - REST write, delete and publish rules do not. A rule naming
cma/entries/update,cma/entries/delete,cma/entries/publishor any other non-read REST operation does not apply to GraphQL, because the GraphQL Content API cannot change content. - Parameter conditions on read rules. A read rule with parameter conditions reaches GraphQL only when its REST operation shares the space (or environment) path parameter. GraphQL requests carry only
space_id, andenvironment_idon the environment routes. A condition on a parameter the GraphQL request does not carry (for exampleentry_id, orenvironment_idon a space route) cannot be judged on that request, so the rule fails closed there: a deny denies every GraphQL read, and an approval rule denies instead of asking. Saving such a rule returns a warning that names the parameter. - Allowlists. REST IDs never grant GraphQL access through an operation allowlist; name the exact
graphql/space/get,graphql/space/post,graphql/environment/getorgraphql/environment/postID, or allow thereadfamily.
The provider requires a Content Delivery access token for published content, or a Content Preview access token when the query includes unpublished content, with access to the requested space and environment (authentication and preview requirements). Classification does not grant an OAuth token additional API access.
Step 1: Create a Contentful OAuth App
Section titled “Step 1: Create a Contentful OAuth App”Go to Contentful OAuth Applications
Navigate to Contentful account settings and go to OAuth applications.
Create a new application
Click New Application.
Configure the application
Enter the application name and description.
Add the redirect URI
Add the Redirect URI from the Developer Portal to the Redirect URI field.
Get credentials
Copy the Client ID and Client Secret.
Step 2: Add to Alter Vault
Section titled “Step 2: Add to Alter Vault”Open the Developer Portal
Go to portal.alterauth.com and navigate to the application.
Add Contentful provider
Go to OAuth Providers > Add Provider > Contentful.
Enter credentials
- Client ID: Paste the Contentful Client ID
- Client Secret: Paste the Contentful Client Secret
Select scopes
Choose the scopes the application needs.
Save
Click Save. The provider is now active.
Available Scopes
Section titled “Available Scopes”| Scope | Description |
|---|---|
content_management_manage | Full access to the Content Management API |
content_management_read | Read-only access to the Content Management API |
- The
content_management_managescope is included by default and provides full read/write access. - Use
content_management_readif the application only needs to read content. - See the Contentful authentication documentation for more details.
Policy-cataloged operations
Section titled “Policy-cataloged operations”Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.
| Operation ID | Families | Method | Provider path |
|---|---|---|---|
graphql/space/get | read | GET | /content/v1/spaces/{space_id} |
graphql/environment/get | read | GET | /content/v1/spaces/{space_id}/environments/{environment_id} |
graphql/space/post | read | POST | /content/v1/spaces/{space_id} |
graphql/environment/post | read | POST | /content/v1/spaces/{space_id}/environments/{environment_id} |
cma/assets/publish | send | PUT | /spaces/{space_id}/environments/{environment_id}/assets/{asset_id}/published |
cma/entries/publish | send | PUT | /spaces/{space_id}/environments/{environment_id}/entries/{entry_id}/published |
cma/entries/delete | delete | DELETE | /spaces/{space_id}/environments/{environment_id}/entries/{entry_id} |
cma/entries/unpublish | delete | DELETE | /spaces/{space_id}/environments/{environment_id}/entries/{entry_id}/published |
cma/assets/create | write | POST | /spaces/{space_id}/environments/{environment_id}/assets |
cma/assets/process | write | PUT | /spaces/{space_id}/environments/{environment_id}/assets/{asset_id}/files/{locale}/process |
cma/entries/create | write | POST | /spaces/{space_id}/environments/{environment_id}/entries |
cma/entries/update | write | PUT | /spaces/{space_id}/environments/{environment_id}/entries/{entry_id} |
cda/assets/get | read | GET | /spaces/{space_id}/environments/{environment_id}/assets/{asset_id} |
cda/assets/list | read | GET | /spaces/{space_id}/environments/{environment_id}/assets |
cda/content-types/list | read | GET | /spaces/{space_id}/environments/{environment_id}/content_types |
cda/entries/get | read | GET | /spaces/{space_id}/environments/{environment_id}/entries/{entry_id} |
cda/entries/list | read | GET | /spaces/{space_id}/environments/{environment_id}/entries |
cda/locales/list | read | GET | /spaces/{space_id}/environments/{environment_id}/locales |
cda/sync | read | GET | /spaces/{space_id}/environments/{environment_id}/sync |
cma/spaces/get | read | GET | /spaces/{space_id} |
cma/users/me | read | GET | /users/me |