log.debug("Preauthenticated Subject is read-only -> create Session");
s = createSession(subject, workspaceName);
} else {
log.debug("Found preauthenticated Subject, try to extend authentication");
// login either using JAAS or custom LoginModule
AuthContext authCtx = context.getSecurityManager().getAuthContext(
null, subject, workspaceName);
try {
authCtx.login();
s = createSession(authCtx, workspaceName);
} catch (javax.security.auth.login.LoginException e) {
// subject could not be extended
log.debug("Preauthentication could not be extended");
s = createSession(subject, workspaceName);