- public final static Subject getSubject() {
- Subject subject = Subject.getSubject(AccessController.getContext());
- if (subject == null)
- throw new ArgeoException("Not authenticated.");
- return subject;
- }
+ // public final static Authentication getAuthentication() {
+ // Set<Authentication> authens = getSubject().getPrincipals(
+ // Authentication.class);
+ // if (authens != null && !authens.isEmpty()) {
+ // Principal principal = authens.iterator().next();
+ // Authentication authentication = (Authentication) principal;
+ // return authentication;
+ // }
+ // throw new ArgeoException("No authentication found");
+ // }
+
+ // public final static Subject getSubject() {
+ // Subject subject = Subject.getSubject(AccessController.getContext());
+ // if (subject == null)
+ // throw new ArgeoException("Not authenticated.");
+ // return subject;
+ // }