Set OAuth2 grant_types so authorization_code login works #12
Reference in New Issue
Block a user
Delete Branch "benvin/oauth2-grant-types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
All Authentik OIDC logins (ArgoCD, Grafana, Rancher, LiteLLM, NetBox) fail with
invalid_request/ "The request is otherwise malformed". Authentik 2026.5 added an explicitgrant_typesallow-list to the OAuth2 provider (model default = empty list, see the 2026.2->2026.5 note in models.py). Our module never set it, so every live provider hasgrant_types = [], and authorize.py rejects the authorization_code grant (if self.grant_type not in self.provider.grant_types) before any user auth. This is global, not per-app drift; it surfaced now because the last apply ran under the 2026.5 provider.Change
grant_typesfield to theproviders_oauth2variable, defaulting to["authorization_code", "refresh_token"](standard confidential web-app set), and wire it intoauthentik_provider_oauth2.Plan
0 to add, 5 to change, 0 to destroy— each oauth2 provider'sgrant_typesgoes[] -> ["authorization_code", "refresh_token"]; no other attributes change. Baseline plan before the change was clean (no netbox/state drift; pipeline-42 objects are already in state).Rollout
Merging triggers the woodpecker apply. Verified locally that the plan is clean; the local apply itself was left for CI. After apply,
/application/o/authorize/?...response_type=codereturns the login flow instead of the error.https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv