Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增钉钉认证登录 Feature/dingding login #2171

Merged
merged 13 commits into from
May 29, 2023
18 changes: 18 additions & 0 deletions archery/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from datetime import timedelta
import environ
import requests
import logging

logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
logger = logging.getLogger(__name__)

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

Expand Down Expand Up @@ -312,6 +318,18 @@
) # 每次登录从ldap同步用户信息
AUTH_LDAP_USER_ATTR_MAP = env("AUTH_LDAP_USER_ATTR_MAP")

if ENABLE_LDAP or ENABLE_DINGDING or ENABLE_LDAP:
logger.info(
"系统外部认证目前支持LDAP、OIDC、DINGDING三种,认证方式只能启用其中一种,如果启用多个,实际生效的只有一个,优先级LDAP > DINGDING > OIDC"
)
authentication = (
"LDAP"
if ENABLE_LDAP
else ("DINGDING" if ENABLE_DINGDING else ("OIDC" if ENABLE_OIDC else ""))
)
logger.info("当前生效的认证方式:" + authentication)
logger.info("认证后端:" + AUTHENTICATION_BACKENDS.__str__())
LeoQuote marked this conversation as resolved.
Show resolved Hide resolved

# LOG配置
LOGGING = {
"version": 1,
Expand Down