X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Fauth%2FUserAdminLoginModule.java;h=db677f57e13dc7f9a5715459dc532248ac054f2f;hb=77319330a8dec1f521e78a2df381f66c1b43100d;hp=53e48e8c1ea4089eb13e7d5bd336c98619dc60c9;hpb=ad9eb24753d1486113cfbc19d8080f15ce5ff68a;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/auth/UserAdminLoginModule.java b/org.argeo.cms/src/org/argeo/cms/auth/UserAdminLoginModule.java index 53e48e8c1..db677f57e 100644 --- a/org.argeo.cms/src/org/argeo/cms/auth/UserAdminLoginModule.java +++ b/org.argeo.cms/src/org/argeo/cms/auth/UserAdminLoginModule.java @@ -70,6 +70,9 @@ public class UserAdminLoginModule implements LoginModule, AuthConstants { } catch (IOException e) { throw new LoginException("Cannot handle http callback: " + e.getMessage()); + } catch (ThreadDeath e) { + throw new ThreadDeathLoginException( + "Callbackhandler thread died", e); } catch (UnsupportedCallbackException e) { return false; } @@ -123,7 +126,7 @@ public class UserAdminLoginModule implements LoginModule, AuthConstants { public boolean commit() throws LoginException { Authorization authorization = subject .getPrivateCredentials(Authorization.class).iterator().next(); - if (request != null) { + if (request != null && authorization.getName() != null) { request.setAttribute(HttpContext.REMOTE_USER, authorization.getName()); request.setAttribute(HttpContext.AUTHORIZATION, authorization);