Skip to content

fix(oauth2): use the slashed authorize endpoint for Authentik - #13819

Merged
HarshMN2345 merged 2 commits into
mainfrom
fix/issue-9567
Sep 22, 2026
Merged

HarshMN2345 merged 2 commits into
mainfrom
fix/issue-9567

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

What does this PR do?

Authentik is Django-backed and serves its OAuth2 authorization endpoint at /application/o/authorize/. getLoginURL() built the unslashed path, so the browser landed on an Authentik 404 instead of the consent screen and Authentik login was unusable.

The rest of the adapter already uses the slashed form for /application/o/token/ and /application/o/userinfo/, so getLoginURL() was the sole outlier. One character.

Test Plan

  • composer lint src/Appwrite/Auth/OAuth2/Authentik.php → {"tool":"pint","result":"passed"}
  • Verified by inspection that the two sibling endpoints in the same class already carry the trailing slash, and that Django's APPEND_SLASH redirect does not apply to the authorize endpoint under Authentik's routing.

Not run: no live Authentik instance was available, so the consent-screen round trip is unverified. Authentik's own documented endpoint is /application/o/authorize/.

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs? — no metadata change

Authentik is Django-backed and serves its OAuth2 authorization endpoint at
/application/o/authorize/. getLoginURL() built the unslashed path, so the
browser landed on an Authentik 404 instead of the consent screen.

The rest of the adapter already uses the slashed form for /application/o/token/
and /application/o/userinfo/, so getLoginURL() was the sole outlier.
@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the focused endpoint correction introduces no identified correctness, security, or repository-rule issues.

Summary

Fixes Authentik OAuth2 login by using the provider’s trailing-slashed authorization endpoint.

  • Changes /application/o/authorize to /application/o/authorize/.
  • Leaves the existing OAuth2 parameters and URL construction unchanged.
  • Aligns the authorization URL with the slashed token and user-info endpoints already used by the adapter.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into fix/issue-9567"

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/issue-9567 (after).

Metric Before After Change
🚀 Requests/sec 162.2 162.62 ⚪ +0.3%
⏱️ Latency P50 105.92 ms 106.92 ms ⚪ +0.9%
⏱️ Latency P95 252.07 ms 249.21 ms ⚪ -1.1%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 106.92 249.21 10,260 162.62 -2.86
Account 199.73 402.09 540 9.26 +5.83
TablesDB 102.99 198.79 5,580 90.64 +2.78
Storage 99.02 213.5 2,700 45.24 -13.04
Functions 148.24 301.12 1,440 24.89 -30.59

Top API waits (after)

API request Max wait (ms)
functions.variables.update 609.2
account.name.update 563.07
functions.delete 537.02
functions.variables.create 495.93
account.prefs.update 465.22

@HarshMN2345
HarshMN2345 merged commit d79c068 into main Sep 22, 2026
50 checks passed
@HarshMN2345 HarshMN2345 mentioned this pull request Sep 23, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Wrong authentik auth URL

2 participants