Bug 311641 no CallerPrincipalCallback is valid

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1709 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
David Jencks 2010-05-04 23:04:35 +00:00
parent 6e395884a6
commit e565312464
1 changed files with 6 additions and 3 deletions

View File

@ -115,12 +115,15 @@ public class JaspiAuthenticator implements Authenticator
{
Set<UserIdentity> ids = clientSubject.getPrivateCredentials(UserIdentity.class);
UserIdentity userIdentity;
if (ids.size() > 0) {
if (ids.size() > 0)
{
userIdentity = ids.iterator().next();
// return new FormAuthenticator.FormAuthentication(this,ids.iterator().next());
} else {
CallerPrincipalCallback principalCallback = _callbackHandler.getThreadCallerPrincipalCallback();
if (principalCallback == null) throw new NullPointerException("No CallerPrincipalCallback");
if (principalCallback == null)
{
return Authentication.UNAUTHENTICATED;
}
Principal principal = principalCallback.getPrincipal();
if (principal == null) {
String principalName = principalCallback.getName();