This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
authentic2-auth-fc/src/authentic2_auth_fc/backends.py

17 lines
462 B
Python

from . import models
from django.contrib.auth.backends import ModelBackend
class FcBackend(ModelBackend):
def authenticate(self, agc=None, **kwargs):
try:
fc_account = models.FcAccount.objects.get(agc=agc)
return fc_account.user
except models.FcAccount.DoesNotExist:
pass
def get_saml2_authn_context(self):
import lasso
return lasso.SAML2_AUTHN_CONTEXT_PASSWORD_PROTECTED_TRANSPORT