feat: sso支持验证mfa

This commit is contained in:
ibuler
2021-08-26 15:01:43 +08:00
committed by Jiangjie.Bai
parent 0f87f05b3f
commit 6241238b45
7 changed files with 23 additions and 20 deletions

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
from .backends import *
from .callback import *

View File

@@ -1,16 +0,0 @@
# -*- coding: utf-8 -*-
#
from django.contrib.auth import get_user_model
User = get_user_model()
def cas_callback(response):
username = response['username']
user, user_created = User.objects.get_or_create(username=username)
profile, created = user.get_profile()
profile.role = response['attributes']['role']
profile.birth_date = response['attributes']['birth_date']
profile.save()