/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
@Override public User getCurrentUser() throws IOException { Authentication auth = securityContextHolderStrategy.getContext().getAuthentication(); if (auth == null) { return null; } User user = securityManager.getUserByLoginName(auth.getName()); if (user == null && auth.isAuthenticated()) { user = new UserImpl(); user.setAdmin(true); user.setActive(true); } return user; }