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

Function create_oauth2_application

api/oauth2_metadata/services.py:40–59  ·  view source on GitHub ↗

Create a public OAuth2 application for dynamic client registration.

(
    *,
    client_name: str,
    redirect_uris: list[str],
)

Source from the content-addressed store, hash-verified

38
39
40def create_oauth2_application(
41 *,
42 client_name: str,
43 redirect_uris: list[str],
44) -> Application:
45 """Create a public OAuth2 application for dynamic client registration."""
46 application: Application = Application.objects.create(
47 name=client_name,
48 client_type=Application.CLIENT_PUBLIC,
49 authorization_grant_type=Application.GRANT_AUTHORIZATION_CODE,
50 client_secret="",
51 redirect_uris=" ".join(redirect_uris),
52 skip_authorization=False,
53 )
54 logger.info(
55 "OAuth2 DCR: registered application %s (client_id=%s).",
56 client_name,
57 application.client_id,
58 )
59 return application

Callers 1

postMethod · 0.90

Calls 1

createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…