goauthentik / goauthentik/authentik

/api/v3/providers/oauth2/ response does not match OpenAPI schema

Open
#18,700 0 comments 0 reactions 0 assignees View on GitHub
bug bug/confirmed
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 2h
Merged PRs (30d)
659

Description

### Describe the bug

Hi all,

the response from the endpoint `/api/v3/providers/oauth2/` does not match the OpenAPI schema provided at `/api/v3/schema/`.

According to the schema, the following fields are marked as required for the OAuth2Provider response:
````
- assigned_application_name
- assigned_application_slug
- assigned_backchannel_application_name
- assigned_backchannel_application_slug
- authorization_flow
- component
- invalidation_flow
- meta_model_name
- name
- pk
- redirect_uris
- verbose_name
- verbose_name_plural
````
However, the actual API response is missing the fields
`assigned_backchannel_application_name` and `assigned_backchannel_application_slug`.
Because of this discrepancy, response validation fails when using the authentic_client Python package, making it impossible to work with the generated models.

### How to reproduce

1. Ensure that an OAuth2 provider is configured.
3. Fetch the OpenAPI schema from your instance: `GET /api/v3/schema/`
5. Fetch the provider list: `GET /api/v3/providers/oauth2/`
7. Observe that the response items do not include `assigned_backchannel_application_name` and `assigned_backchannel_application_slug`, although the schema marks them as required.

### Expected behavior

The API response should match the OpenAPI schema so that automatic validation (e.g., via the authentic_client Python package) succeeds without errors.

### Screenshots

_No response_

### Additional context

_No response_

### Deployment Method

Kubernetes

### Version

2025.10.2

### Relevant log output

```shell
E pydantic_core._pydantic_core.ValidationError: 2 validation errors for PaginatedOAuth2ProviderList
E results.0.assigned_backchannel_application_slug
E Field required [type=missing, input_value={'pk': 999, 'name': 'xxx Pr...deration_providers': []}, input_type=dict]
E For further information visit https://errors.pydantic.dev/2.12/v/missing
E results.0.assigned_backchannel_application_name
E Field required [type=missing, input_value={'pk': 999, 'name': 'xxx Pr...deration_providers': []}, input_type=dict]
E For further information visit https://errors.pydantic.dev/2.12/v/missing
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.