登录拦截器
依赖两个重载的 Bean:
登录与校验流程如下:
用户注销的时候,在拦截器方法 afterLogout 中会自动删除上面的 cookie。
| Modifiers | Name | Description |
|---|---|---|
static String |
NAME |
| Fields inherited from class | Fields |
|---|---|
class bropen.framework.core.security.sso.SsoInterceptor |
logger, __$stMC |
| Constructor and description |
|---|
SsoTokenInterceptor
(Boolean ldapUsers) |
| Type | Name and description |
|---|---|
void |
afterLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username)登录后,生成 token,并写入 Cookie |
void |
afterLogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)如果是数据库里没有注册的 ldap 用户,避免被自动注销 |
Object |
sso(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)SSO 客户端:恢复登录 |
| Methods inherited from class | Name |
|---|---|
class bropen.framework.core.security.sso.SsoInterceptor |
bropen.framework.core.security.sso.SsoInterceptor#sso(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), bropen.framework.core.security.sso.SsoInterceptor#setOverwritable(Boolean), bropen.framework.core.security.sso.SsoInterceptor#afterSso(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, String), bropen.framework.core.security.sso.SsoInterceptor#getOverwritable(), bropen.framework.core.security.sso.SsoInterceptor#afterLogin(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, String), bropen.framework.core.security.sso.SsoInterceptor#afterLogout(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), bropen.framework.core.security.sso.SsoInterceptor#getMetaClass(), bropen.framework.core.security.sso.SsoInterceptor#setMetaClass(MetaClass), bropen.framework.core.security.sso.SsoInterceptor#setAttributes(Map), bropen.framework.core.security.sso.SsoInterceptor#invokeMethod(String, Object), bropen.framework.core.security.sso.SsoInterceptor#setProperty(String, Object), bropen.framework.core.security.sso.SsoInterceptor#getProperty(String), bropen.framework.core.security.sso.SsoInterceptor#getName(), bropen.framework.core.security.sso.SsoInterceptor#setPriority(Integer), bropen.framework.core.security.sso.SsoInterceptor#getPriority(), bropen.framework.core.security.sso.SsoInterceptor#setName(String), bropen.framework.core.security.sso.SsoInterceptor#getAttributes(), bropen.framework.core.security.sso.SsoInterceptor#wait(long, int), bropen.framework.core.security.sso.SsoInterceptor#wait(long), bropen.framework.core.security.sso.SsoInterceptor#wait(), bropen.framework.core.security.sso.SsoInterceptor#equals(Object), bropen.framework.core.security.sso.SsoInterceptor#toString(), bropen.framework.core.security.sso.SsoInterceptor#hashCode(), bropen.framework.core.security.sso.SsoInterceptor#getClass(), bropen.framework.core.security.sso.SsoInterceptor#notify(), bropen.framework.core.security.sso.SsoInterceptor#notifyAll() |
class Object |
Object#wait(long, int), Object#wait(long), Object#wait(), Object#equals(Object), Object#toString(), Object#hashCode(), Object#getClass(), Object#notify(), Object#notifyAll() |
登录后,生成 token,并写入 Cookie
如果是数据库里没有注册的 ldap 用户,避免被自动注销
SSO 客户端:恢复登录
BROPEN Documentation, 2020-04-21 12:12