feat(oidc): Mobile-Scopes serverseitig konfigurierbar (offline_access)
Die Apps duerfen keine Scopes erfinden: ein Scope, den der Provider nicht kennt, laesst ihn die gesamte Authorization-Anfrage ablehnen. Daher legt jetzt der Server fest, was die nativen Clients anfragen. OIDC_<KEY>_MOBILE_SCOPES ist frei setzbar; ohne Angabe sind es die Web-Scopes plus offline_access, damit Authentik ab 2024.2 ueberhaupt ein Refresh-Token ausstellt. Der Browser-Flow bleibt unveraendert, der braucht kein offline_access. Ausgeliefert wird der Wert als mobile_scopes in /api/auth/oidc/providers, aber nur wenn eine MOBILE_CLIENT_ID konfiguriert ist. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
25fde49cee
commit
07235fd4c9
@@ -123,6 +123,9 @@ def list_providers():
|
||||
}
|
||||
if provider.mobile_client_ids:
|
||||
entry["mobile_client_id"] = provider.mobile_client_ids[0]
|
||||
# The apps request exactly these — they must not invent scopes of
|
||||
# their own, or a provider that lacks one rejects the whole flow.
|
||||
entry["mobile_scopes"] = provider.mobile_scopes
|
||||
try:
|
||||
doc = oidc_client.discover(provider)
|
||||
entry["authorization_endpoint"] = doc.get("authorization_endpoint")
|
||||
|
||||
Reference in New Issue
Block a user