Subject alreadyAuthenticated = ... Session s = (Session) Subject.doAs(alreadyAuthenticated, new PrivilegedAction() { public Object run() { return Repository.login(); } });
just wanted to confirm that this does indeed work. thanks much!
cool, lucky shot ;)
and just to avoid confusion Repository.login() is not a static method of course. so, it should be rather:
final Repository repo = ...
Subject alreadyAuthenticated = ...
Session s = (Session) Subject.doAs(alreadyAuthenticated,
new PrivilegedAction() {
public Object run() {
return repo.login();
}
});regards marcel
