MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / authorization_server_metadata

Function authorization_server_metadata

api/oauth2_metadata/views.py:26–49  ·  view source on GitHub ↗

RFC 8414 OAuth 2.0 Authorization Server Metadata.

(request: HttpRequest)

Source from the content-addressed store, hash-verified

24@csrf_exempt
25@require_GET
26def authorization_server_metadata(request: HttpRequest) -> JsonResponse:
27 """RFC 8414 OAuth 2.0 Authorization Server Metadata."""
28 oauth = OAuthConfig.from_settings()
29
30 metadata = {
31 "issuer": oauth.api_url,
32 "authorization_endpoint": f"{oauth.frontend_url}/oauth/authorize/",
33 "token_endpoint": f"{oauth.api_url}/o/token/",
34 "registration_endpoint": f"{oauth.api_url}/o/register/",
35 "revocation_endpoint": f"{oauth.api_url}/o/revoke_token/",
36 "introspection_endpoint": f"{oauth.api_url}/o/introspect/",
37 "scopes_supported": list(oauth.scopes.keys()),
38 "response_types_supported": ["code"],
39 "grant_types_supported": ["authorization_code", "refresh_token"],
40 "code_challenge_methods_supported": ["S256"],
41 "token_endpoint_auth_methods_supported": [
42 "client_secret_basic",
43 "client_secret_post",
44 "none",
45 ],
46 "introspection_endpoint_auth_methods_supported": ["none"],
47 }
48
49 return JsonResponse(metadata)
50
51
52class OAuthAuthorizeView(OAuthLibMixin, APIView): # type: ignore[misc]

Callers

nothing calls this directly

Calls 1

from_settingsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…