# auth.md

CVD Portal authenticates agents through an OAuth 2.1 authorization server with dynamic client registration or through legacy bearer API keys. Anonymous agents need no credential to file a vulnerability report through a company public portal.

## Key takeaways

- Two agent audiences exist. A researcher agent files vulnerability reports. A company agent manages company compliance records.
- A researcher agent needs no credential to submit a report through a company portal at `https://<company>.cvdportal.com`.
- A company agent obtains an OAuth 2.1 access token with PKCE, or uses a legacy bearer API key created by an administrator.
- Dynamic client registration is available at `https://cvdportal.com/api/oauth/register` for autonomous agents.
- The supported credential method is the HTTP `Authorization: Bearer <token>` header.

## Which agents this applies to

CVD Portal is a compliance platform for manufacturers that sell products with digital elements into the European Union. Two machine surfaces are open to agents.

The public portal accepts vulnerability reports about a company's products. A security researcher, or an agent acting for one, is the audience.

The company API and the Model Context Protocol server read and write that company's own records. Vulnerability reports, products, Software Bill of Materials documents, scan findings and compliance status are available. An agent acting for the company that owns the records is the audience.

## Anonymous vulnerability submission

No credential is required. Submit the report through the company's public portal.

| Item | Value |
|---|---|
| Method | Anonymous. No credential |
| Portal | `https://<company>.cvdportal.com` |
| Report form | `https://<company>.cvdportal.com/submit` |
| Disclosure policy | `https://<company>.cvdportal.com/.well-known/security.txt` |

Read the company's `security.txt` file first. The file names the accepted languages, the preferred report format and the disclosure policy that applies.

A company agent that holds an API key or an OAuth token with the `submissions:write` scope can submit the same report to `POST https://cvdportal.com/api/v1/vulnerabilities` instead.

## OAuth 2.1 authorization server

CVD Portal operates a standards-compliant OAuth 2.1 authorization server. Agents obtain short-lived, scope-limited access tokens using the authorization code grant with mandatory PKCE (RFC 7636).

### Endpoints

| Endpoint | URL | Purpose |
|---|---|---|
| Authorization | `https://cvdportal.com/api/oauth/authorize` | Authorization code request with PKCE S256 |
| Token | `https://cvdportal.com/api/oauth/token` | Code exchange and refresh token rotation |
| Dynamic registration | `https://cvdportal.com/api/oauth/register` | RFC 7591 dynamic client registration |
| Introspection | `https://cvdportal.com/api/oauth/introspect` | RFC 7662 token active state and metadata |
| Revocation | `https://cvdportal.com/api/oauth/revoke` | RFC 7009 token revocation |

### How an agent obtains an OAuth token

1. Register client metadata at `POST https://cvdportal.com/api/oauth/register` per RFC 7591, providing `client_name` and `redirect_uris`. The server issues a `client_id`.
2. Generate an RFC 7636 `code_verifier` and compute its S256 `code_challenge`.
3. Direct the browser or user to `https://cvdportal.com/api/oauth/authorize?response_type=code&client_id=<client_id>&redirect_uri=<redirect_uri>&code_challenge=<challenge>&code_challenge_method=S256&scope=<scopes>`.
4. The authenticated user grants consent on the consent screen.
5. The authorization server redirects to the registered `redirect_uri` with a single-use authorization code.
6. Exchange the code at `POST https://cvdportal.com/api/oauth/token` with `code_verifier`, receiving an access token and refresh token.

### PKCE requirement

PKCE is mandatory for all clients. The `code_challenge_method` must be `S256`. The plain transformation is rejected.

### Token lifetimes and rotation

| Token type | Default lifetime | Configuration |
|---|---|---|
| Access token | 3600 seconds (1 hour) | `OAUTH_ACCESS_TOKEN_TTL_SECONDS` |
| Refresh token | 2592000 seconds (30 days) | `OAUTH_REFRESH_TOKEN_TTL_SECONDS` |
| Authorization code | 300 seconds (5 minutes) | Single-use. Consumed on exchange |

Refresh tokens rotate on every use. Exchanging a refresh token issues a new access token and a new refresh token while revoking the previous one.

### How to send the OAuth token

Send the access token in the HTTP `Authorization` header with the `Bearer` prefix.

```http
GET /api/v1/vulnerabilities HTTP/1.1
Host: cvdportal.com
Authorization: Bearer <access_token>
```

The same access token authenticates the Model Context Protocol server at `https://cvdportal.com/api/mcp`.

## Legacy bearer API keys

A company administrator can provision static bearer API keys in the dashboard as an alternative to OAuth 2.1.

### How to get a legacy key

1. An administrator signs in to the dashboard.
2. The administrator opens `https://cvdportal.com/settings/api-keys`.
3. The administrator creates a key and selects scopes and an optional source address allowlist.
4. The dashboard displays the key one time.

| Item | Value |
|---|---|
| Provisioning surface | `https://cvdportal.com/settings/api-keys` |
| Provisioning endpoint | `POST https://cvdportal.com/api/settings/api-keys` |
| Caller | Signed-in administrator |
| Required plan | Enterprise |
| Key format | 64 lowercase hexadecimal characters |
| Rate limit | 100 requests per 60 seconds |
| Default expiry | 365 days |
| Maximum expiry | 3650 days |

## Scopes

An agent requests scopes during authorization or client registration. Requests outside the granted scopes return HTTP 403.

| Scope | Grants |
|---|---|
| `read` | Read vulnerabilities, products, compliance & SBOM metadata |
| `submissions:write` | Submit vulnerability reports |
| `submissions:triage` | Triage and progress vulnerability reports |
| `submissions:communicate` | Draft messages to reporters for approval |
| `products:write` | Create and update products |
| `sbom:write` | Push SBOMs from CI/CD |
| `sarif:write` | Push pipeline scan findings (SARIF, FOSSA) |
| `gate:write` | Store release gate verdicts from CI/CD |
| `webhooks:write` | Register webhooks |
| `gdpr:export` | Export all company data (DSAR) |
| `account:export` | Export the full tenant data set for switching (EU Data Act) |
| `forge:submissions:read` | Atlassian app: read submissions for Jira sync |
| `forge:submissions:write` | Atlassian app: record Jira sync state |
| `forge:evidence:write` | Atlassian app: link Confluence pages as CRA evidence |
| `article14:prepare` | Prepare CRA Article 14 notification dossiers |
| `advisory:draft` | Draft CSAF and OpenVEX security advisories |
| `conformity:prepare` | Prepare conformity assessment, import prefill & technical files |

A legacy key created with no scopes is unrestricted. OAuth tokens strictly enforce the consented scope list.

## OAuth discovery metadata

CVD Portal publishes standard discovery documents for automated client discovery and registration.

| Document | Standard | Purpose |
|---|---|---|
| `https://cvdportal.com/.well-known/oauth-authorization-server` | RFC 8414 | Authorization server metadata and endpoint locations |
| `https://cvdportal.com/.well-known/oauth-protected-resource` | RFC 9728 | Protected resource metadata pointing to the authorization server |
| `https://cvdportal.com/openapi.json` | OpenAPI 3.0 | OpenAPI specification for the version 1 REST API |
| `https://cvdportal.com/.well-known/api-catalog` | RFC 9727 | Linkset to specification, documentation and health endpoints |
| `https://cvdportal.com/.well-known/agent-skills/index.json` | Agent Skills | Agent skill descriptions for this platform |
| `https://cvdportal.com/.well-known/agent-card.json` | A2A | Agent-to-agent discovery card (A2A protocol 1.0) |
| `https://cvdportal.com/llms.txt` | /llms.txt | Index of the public content corpus |

## Contact

Write to security@cvdportal.com for questions about credential handling. Read https://docs.cvdportal.com/cvd/api-overview for the developer guide, and https://docs.cvdportal.com/cvd/mcp-server for the Model Context Protocol server.

Report a vulnerability in CVD Portal itself through `https://cvdportal.com/.well-known/security.txt`.

Last updated: 2026-09-11
