Première implementation de sso
This commit is contained in:
15
cerfig_sso_authentification/sso.py
Normal file
15
cerfig_sso_authentification/sso.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from simple_sso.sso_server.server import Server
|
||||
from authentification.models import Employe
|
||||
|
||||
class CerfigSSOServer(Server):
|
||||
def get_user_data(self, user, consumer, extra_data=None):
|
||||
user_data = super().get_user_data(user, consumer, extra_data)
|
||||
employe = Employe.objects.get(user=user)
|
||||
|
||||
user_data.update({
|
||||
'departement': employe.departement.nom,
|
||||
'chef_departement': employe.chef,
|
||||
'groups': [group.name for group in user.groups.all()],
|
||||
})
|
||||
|
||||
return user_data
|
||||
Reference in New Issue
Block a user