类org.springframework.security.authentication.RememberMeAuthenticationToken源码实例Demo

下面列出了怎么用org.springframework.security.authentication.RememberMeAuthenticationToken的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
	Authentication auth = SecurityContextHolder.getContext().getAuthentication();
	if (auth != null) {
		return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
	} else {
		return false;
	}
}
 
源代码2 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
	Authentication auth=SecurityContextHolder.getContext().getAuthentication();
	if(auth!=null){
		return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
	}
	else
	return false;
}
 
源代码3 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (auth != null) {
        return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
    } else
        return false;
}
 
源代码4 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (auth != null) {
        return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
    } else
        return false;
}
 
源代码5 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
	Authentication auth = SecurityContextHolder.getContext().getAuthentication();
	if (auth != null) {
		return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
	} else {
		return false;
	}
}
 
源代码6 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (auth != null) {
        return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
    } else
        return false;
}
 
源代码7 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (auth != null) {
        return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
    } else
        return false;
}
 
源代码8 项目: Spring   文件: HomeController.java
private boolean rememberMeCheck() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (auth != null) {
        return (auth instanceof AnonymousAuthenticationToken || auth instanceof RememberMeAuthenticationToken);
    } else
        return false;
}
 
源代码9 项目: spring-boot-cookbook   文件: IndexController.java
/**
 * 判断用户是否从Remember Me Cookie自动登录
 *
 * @return
 */
private boolean isRememberMeAuthenticated() {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (authentication == null) {
        return false;
    }
    return RememberMeAuthenticationToken.class.isAssignableFrom(authentication.getClass());
}
 
源代码10 项目: flowable-engine   文件: FlowableCookieFilter.java
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
    if (!skipAuthenticationCheck(request)) {
        RemoteToken token = getValidToken(request);
        if (token != null) {
            try {
                FlowableAppUser appUser = userCache.get(token.getUserId());
                if (!validateRequiredPriviliges(request, response, appUser)) {
                    redirectOrSendNotPermitted(request, response, appUser.getUserObject().getId());
                    return; // no need to execute any other filters
                }
                SecurityContextHolder.getContext().setAuthentication(new RememberMeAuthenticationToken(token.getId(),
                    appUser, appUser.getAuthorities()));

            } catch (Exception e) {
                LOGGER.trace("Could not set necessary threadlocals for token", e);
                redirectOrSendNotPermitted(request, response, token.getUserId());
            }
            if (filterCallback != null) {
                filterCallback.onValidTokenFound(request, response, token);
            }
        } else {
            redirectOrSendNotPermitted(request, response, null);
            return; // no need to execute any other filters
        }
    }

    try {
        filterChain.doFilter(request, response);
    } finally {
        if (filterCallback != null) {
            filterCallback.onFilterCleanup(request, response);
        }
    }
}
 
源代码11 项目: zhcet-web   文件: SecurityUtils.java
public static boolean isRememberMe(Authentication authentication) {
    return authentication != null && authentication.getClass().isAssignableFrom(RememberMeAuthenticationToken.class);
}
 
源代码12 项目: lemon   文件: AuthenticatedVoter.java
public boolean isRemembered(Authentication authentication, String attribute) {
    return IS_REMEMBERED.equals(attribute)
            && RememberMeAuthenticationToken.class
                    .isAssignableFrom(authentication.getClass());
}
 
源代码13 项目: keycloak   文件: KeycloakLogoutHandlerTest.java
@Test
public void testLogoutRememberMeAuthentication() throws Exception {
    Authentication authentication = new RememberMeAuthenticationToken(UUID.randomUUID().toString(), UUID.randomUUID().toString(), authorities);
    keycloakLogoutHandler.logout(request, response, authentication);
    verifyZeroInteractions(session);
}
 
 同包方法