mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
✨ Allow to configure scopes in generic SSO
Signed-off-by: Lunik <lunik@tiwabbit.fr>
This commit is contained in:
parent
b96330c5dd
commit
af4537e421
2 changed files with 5 additions and 0 deletions
|
@ -4490,6 +4490,7 @@ async def google_login(request: Request):
|
|||
from fastapi_sso.sso.generic import create_provider, DiscoveryDocument
|
||||
|
||||
generic_client_secret = os.getenv("GENERIC_CLIENT_SECRET", None)
|
||||
generic_scope = os.getenv("GENERIC_SCOPE", "openid email profile").split(" ")
|
||||
generic_authorization_endpoint = os.getenv(
|
||||
"GENERIC_AUTHORIZATION_ENDPOINT", None
|
||||
)
|
||||
|
@ -4540,6 +4541,7 @@ async def google_login(request: Request):
|
|||
client_secret=generic_client_secret,
|
||||
redirect_uri=redirect_url,
|
||||
allow_insecure_http=True,
|
||||
scope=generic_scope,
|
||||
)
|
||||
with generic_sso:
|
||||
return await generic_sso.get_login_redirect()
|
||||
|
@ -4690,6 +4692,7 @@ async def auth_callback(request: Request):
|
|||
from fastapi_sso.sso.generic import create_provider, DiscoveryDocument
|
||||
|
||||
generic_client_secret = os.getenv("GENERIC_CLIENT_SECRET", None)
|
||||
generic_scope = os.getenv("GENERIC_SCOPE", "openid email profile").split(" ")
|
||||
generic_authorization_endpoint = os.getenv(
|
||||
"GENERIC_AUTHORIZATION_ENDPOINT", None
|
||||
)
|
||||
|
@ -4740,6 +4743,7 @@ async def auth_callback(request: Request):
|
|||
client_secret=generic_client_secret,
|
||||
redirect_uri=redirect_url,
|
||||
allow_insecure_http=True,
|
||||
scope=generic_scope,
|
||||
)
|
||||
verbose_proxy_logger.debug(f"calling generic_sso.verify_and_process")
|
||||
request_body = await request.body()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue