diff --git a/maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/session/Session.java b/maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/session/Session.java index 4e94c6a26..725b42ac1 100644 --- a/maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/session/Session.java +++ b/maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/session/Session.java @@ -29,14 +29,7 @@ public class Session implements Serializable{ private static final long serialVersionUID = 9008067569150338296L; public static final int MAX_EXPIRY_DURATION = 60 * 5; //default 5 minutes. - - public class CATEGORY{ - - public static final int SIGN = 1; - - public static final int MGMT = 5; - } - + public String id; public LocalDateTime startTimestamp; diff --git a/maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/session/SessionCategory.java b/maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/session/SessionCategory.java new file mode 100644 index 000000000..0a07d601b --- /dev/null +++ b/maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/session/SessionCategory.java @@ -0,0 +1,30 @@ +/* + * Copyright [2025] [MaxKey of copyright http://www.maxkey.top] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.dromara.maxkey.authn.session; + +public class SessionCategory { + /** + * 认证端 + */ + public static final int SIGN = 1; + + /** + * 管理端 + */ + public static final int MGMT = 5; +} diff --git a/maxkey-authentications/maxkey-authentication-provider-mgt/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java b/maxkey-authentications/maxkey-authentication-provider-mgt/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java index dbb600d70..e56c325ae 100644 --- a/maxkey-authentications/maxkey-authentication-provider-mgt/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java +++ b/maxkey-authentications/maxkey-authentication-provider-mgt/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java @@ -22,7 +22,7 @@ import java.util.List; import org.dromara.maxkey.authn.SignPrincipal; import org.dromara.maxkey.authn.realm.ldap.LdapAuthenticationRealmService; -import org.dromara.maxkey.authn.session.Session.CATEGORY; +import org.dromara.maxkey.authn.session.SessionCategory; import org.dromara.maxkey.entity.history.HistoryLogin; import org.dromara.maxkey.entity.idm.Groups; import org.dromara.maxkey.entity.idm.UserInfo; @@ -149,7 +149,7 @@ public abstract class AbstractAuthenticationRealm { historyLogin.setUsername(userInfo.getUsername()); historyLogin.setDisplayName(userInfo.getDisplayName()); historyLogin.setInstId(userInfo.getInstId()); - historyLogin.setCategory(CATEGORY.MGMT); + historyLogin.setCategory(SessionCategory.MGMT); Region ipRegion =ipLocationParser.region(userInfo.getLastLoginIp()); if(ipRegion != null) { diff --git a/maxkey-authentications/maxkey-authentication-provider/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java b/maxkey-authentications/maxkey-authentication-provider/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java index c5bc529af..27914f57f 100644 --- a/maxkey-authentications/maxkey-authentication-provider/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java +++ b/maxkey-authentications/maxkey-authentication-provider/src/main/java/org/dromara/maxkey/authn/realm/AbstractAuthenticationRealm.java @@ -22,7 +22,7 @@ import java.util.List; import org.dromara.maxkey.authn.SignPrincipal; import org.dromara.maxkey.authn.realm.ldap.LdapAuthenticationRealmService; -import org.dromara.maxkey.authn.session.Session.CATEGORY; +import org.dromara.maxkey.authn.session.SessionCategory; import org.dromara.maxkey.entity.history.HistoryLogin; import org.dromara.maxkey.entity.idm.Groups; import org.dromara.maxkey.entity.idm.UserInfo; @@ -149,7 +149,7 @@ public abstract class AbstractAuthenticationRealm { historyLogin.setUsername(userInfo.getUsername()); historyLogin.setDisplayName(userInfo.getDisplayName()); historyLogin.setInstId(userInfo.getInstId()); - historyLogin.setCategory(CATEGORY.SIGN); + historyLogin.setCategory(SessionCategory.SIGN); Region ipRegion =ipLocationParser.region(userInfo.getLastLoginIp()); if(ipRegion != null) { diff --git a/maxkey-web-frontend/maxkey-web-app/src/environments/environment.ts b/maxkey-web-frontend/maxkey-web-app/src/environments/environment.ts index 6ee036046..3272b225c 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/environments/environment.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/environments/environment.ts @@ -27,7 +27,7 @@ export const environment = { production: false, useHash: true, api: { - baseUrl: 'http://localhost:9527/sign/', + baseUrl: 'http://sso.maxkey.top/sign/', // baseUrl: '/sign/', refreshTokenEnabled: true, refreshTokenType: 're-request' diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyConfig.java b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyConfig.java index c7abbaf94..aaeaab5ec 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyConfig.java +++ b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyConfig.java @@ -27,7 +27,7 @@ import java.util.stream.Collectors; import org.dromara.maxkey.authn.listener.SessionListenerAdapter; import org.dromara.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm; import org.dromara.maxkey.authn.realm.ldap.LdapAuthenticationRealmService; -import org.dromara.maxkey.authn.session.Session.CATEGORY; +import org.dromara.maxkey.authn.session.SessionCategory; import org.dromara.maxkey.authn.session.SessionManager; import org.dromara.maxkey.authn.support.kerberos.KerberosProxy; import org.dromara.maxkey.authn.support.kerberos.RemoteKerberosService; @@ -212,7 +212,7 @@ public class MaxKeyConfig { .setCron("0 0/10 * * * ?") .setJobClass(SessionListenerAdapter.class) .setJobData("sessionManager",sessionManager) - .setJobData("category", CATEGORY.SIGN) + .setJobData("category", SessionCategory.SIGN) .build(); logger.debug("Session ListenerAdapter inited ."); } diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyMgtListenerConfig.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyMgtListenerConfig.java index 1b2c5cebb..89032ac9e 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyMgtListenerConfig.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyMgtListenerConfig.java @@ -18,7 +18,7 @@ package org.dromara.maxkey.autoconfigure; import org.dromara.maxkey.authn.listener.SessionListenerAdapter; -import org.dromara.maxkey.authn.session.Session.CATEGORY; +import org.dromara.maxkey.authn.session.SessionCategory; import org.dromara.maxkey.authn.session.SessionManager; import org.dromara.maxkey.configuration.ApplicationConfig; import org.dromara.maxkey.listener.DynamicGroupsListenerAdapter; @@ -53,7 +53,7 @@ public class MaxKeyMgtListenerConfig { .setCron("0 0/10 * * * ?") .setJobClass(SessionListenerAdapter.class) .setJobData("sessionManager",sessionManager) - .setJobData("category", CATEGORY.MGMT) + .setJobData("category", SessionCategory.MGMT) .build(); logger.debug("Session ListenerAdapter inited ."); return "sessionListenerAdapter";