kadenios/shared/auth/utils.py

15 lines
364 B
Python
Raw Normal View History

2020-12-21 00:07:07 +01:00
from urllib.parse import urlunparse
from cas import CASClient
def get_cas_client(request):
"""Return a CAS client configured for SPI's CAS."""
return CASClient(
version=3,
service_url=urlunparse(
(request.scheme, request.get_host(), request.path, "", "", "")
),
server_url="https://cas.eleves.ens.fr/",
)