List of usage examples for org.apache.shiro.mgt DefaultSecurityManager createSubject
public Subject createSubject(SubjectContext subjectContext)
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/* w w w . j a va 2 s . c o 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(); } }