List of usage examples for org.apache.shiro.mgt DefaultSecurityManager login
public Subject login(Subject subject, AuthenticationToken token) throws AuthenticationException
From source file:org.openengsb.core.security.internal.RootSubjectHolder.java
License:Apache License
public static void init() { DefaultSecurityManager defaultSecurityManager = new DefaultSecurityManager(); defaultSecurityManager.setAuthenticator(new Authenticator() { @Override/*from www .j a v a 2 s. co m*/ public AuthenticationInfo authenticate(AuthenticationToken authenticationToken) throws AuthenticationException { return new SimpleAuthenticationInfo(new Object(), null, "openengsb"); } }); Subject subject = defaultSecurityManager.createSubject(new DefaultSubjectContext()); synchronized (rootSubject) { rootSubject.set(defaultSecurityManager.login(subject, null)); rootSubject.notifyAll(); } }