324505 Implement API login

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2634 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2011-01-10 13:13:30 +00:00
parent d30089db18
commit 59fbd8bc99
2 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,7 @@ jetty-7.3.0-SNAPSHOT
+ 333481 Handle UTF-32 codepoints
+ 333608 tlds defined in web.xml are not picked up
+ 333679 Refactored jetty-jmx. Moved mbeans to modules.
+ 324505 Implement API login
jetty-7.2.2.v20101205 5 December 2010
+ JETTY-1308 327109 (re)fixed AJP handling of empty packets

View File

@ -27,18 +27,20 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.security.Authenticator;
import org.eclipse.jetty.security.IdentityService;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.log.Log;
public class DeferredAuthentication implements Authentication.Deferred
{
protected final Authenticator _authenticator;
protected final LoginAuthenticator _authenticator;
private IdentityService _identityService;
private Object _previousAssociation;
public DeferredAuthentication(Authenticator authenticator)
public DeferredAuthentication(LoginAuthenticator authenticator)
{
if (authenticator == null)
throw new NullPointerException("No Authenticator");
@ -113,7 +115,10 @@ public class DeferredAuthentication implements Authentication.Deferred
*/
public Authentication login(String username, String password)
{
return null; // TODO implement
UserIdentity user = _authenticator.getLoginService().login(username,password);
if (user!=null)
return new UserAuthentication("API",user);
return null;
}
/* ------------------------------------------------------------ */