mirror of
https://github.com/dataease/dataease.git
synced 2026-05-14 21:12:33 +08:00
Merge pull request #8526 from dataease/pr@dev-v2@feat_ldap
feat(X-Pack): 整合ldap
This commit is contained in:
@@ -111,6 +111,8 @@ service.interceptors.request.use(
|
||||
;(config.headers as AxiosRequestHeaders)['X-DE-LINK-TOKEN'] = linkStore.getLinkToken
|
||||
} else if (embeddedStore.token) {
|
||||
;(config.headers as AxiosRequestHeaders)['X-EMBEDDED-TOKEN'] = embeddedStore.token
|
||||
} else if (wsCache.get('de-ldap-token')) {
|
||||
;(config.headers as AxiosRequestHeaders)['Authorization'] = wsCache.get('de-ldap-token')
|
||||
}
|
||||
if (wsCache.get('user.language')) {
|
||||
const key = wsCache.get('user.language')
|
||||
|
||||
2
de-xpack
2
de-xpack
Submodule de-xpack updated: f846f87140...c7ce3cd116
@@ -21,6 +21,7 @@ public class AuthConstant {
|
||||
public final static String ASK_TOKEN_KEY = "X-DE-ASK-TOKEN";
|
||||
|
||||
public final static String DE_EXECUTE_VERSION = "X-DE-EXECUTE-VERSION";
|
||||
public final static String DE_LDAP_AUTHORIZATION = "Authorization";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.dataease.constant.AuthConstant;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
@@ -35,6 +36,12 @@ public class ServletUtils {
|
||||
return getHead(AuthConstant.OIDC_X_USER);
|
||||
}
|
||||
|
||||
public static String getLdapUser() {
|
||||
String authorization = getHead(AuthConstant.DE_LDAP_AUTHORIZATION);
|
||||
if (StringUtils.isBlank(authorization)) return null;
|
||||
return authorization;
|
||||
}
|
||||
|
||||
public static String getCasUser() {
|
||||
return getHead(AuthConstant.CAS_X_USER);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user