MCPcopy Create free account
hub / github.com/Chainlit/cookbook / custom_oauth_enabled

Function custom_oauth_enabled

auth/inject_custom_auth.py:13–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13def custom_oauth_enabled():
14 if (
15 os.environ.get("OAUTH_AZURE_AD_B2C_CLIENT_ID") is not None
16 and os.environ.get("OAUTH_AZURE_AD_B2C_CLIENT_SECRET") is not None
17 and os.environ.get("OAUTH_AZURE_AD_B2C_TENANT_ID") is not None
18 and os.environ.get("OAUTH_AZURE_AD_B2C_TENANT_NAME") is not None
19 and os.environ.get("OAUTH_AZURE_AD_B2C_REDIRECT_URL") is not None
20 and os.environ.get("OAUTH_AZURE_AD_B2C_POLICY") is not None
21 ):
22 print("B2C OAuth configured.")
23 return True
24 else:
25 print("B2C OAuth not configured. Skipping...")
26 return False
27
28
29def provider_id_in_instance_list(provider_id: str):

Callers 1

Calls 1

getMethod · 0.80

Tested by

no test coverage detected