mirror of https://github.com/jumpserver/jumpserver
[Update] 调整openid backend顺序;openid 用户创建/更新添加日志输出
parent
c0089a98f4
commit
9eee79f7d4
|
@ -427,8 +427,8 @@ class DynamicConfig:
|
|||
if self.static_config.get('AUTH_CAS'):
|
||||
backends.insert(0, 'authentication.backends.cas.CASBackend')
|
||||
if self.static_config.get('AUTH_OPENID'):
|
||||
backends.insert(0, 'jms_oidc_rp.backends.OIDCAuthCodeBackend')
|
||||
backends.insert(0, 'jms_oidc_rp.backends.OIDCAuthPasswordBackend')
|
||||
backends.insert(0, 'jms_oidc_rp.backends.OIDCAuthCodeBackend')
|
||||
if self.static_config.get('AUTH_RADIUS'):
|
||||
backends.insert(0, 'authentication.backends.radius.RadiusBackend')
|
||||
return backends
|
||||
|
|
|
@ -56,9 +56,18 @@ def on_ldap_create_user(sender, user, ldap_user, **kwargs):
|
|||
@receiver(openid_create_or_update_user)
|
||||
def on_openid_create_or_update_user(sender, request, user, created, name, username, email, **kwargs):
|
||||
if created:
|
||||
logger.debug(
|
||||
"Receive OpenID user created signal: {}, "
|
||||
"Set user source is: {}".format(user, User.SOURCE_OPENID)
|
||||
)
|
||||
user.source = User.SOURCE_OPENID
|
||||
user.save()
|
||||
elif not created and settings.AUTH_OPENID_ALWAYS_UPDATE_USER:
|
||||
logger.debug(
|
||||
"Receive OpenID user updated signal: {}, "
|
||||
"Update user info: {}"
|
||||
"".format(user, "name: {}|username: {}|email: {}".format(name, username, email))
|
||||
)
|
||||
user.name = name
|
||||
user.username = username
|
||||
user.email = email
|
||||
|
|
Loading…
Reference in New Issue