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:
parent
d30089db18
commit
59fbd8bc99
|
@ -11,6 +11,7 @@ jetty-7.3.0-SNAPSHOT
|
||||||
+ 333481 Handle UTF-32 codepoints
|
+ 333481 Handle UTF-32 codepoints
|
||||||
+ 333608 tlds defined in web.xml are not picked up
|
+ 333608 tlds defined in web.xml are not picked up
|
||||||
+ 333679 Refactored jetty-jmx. Moved mbeans to modules.
|
+ 333679 Refactored jetty-jmx. Moved mbeans to modules.
|
||||||
|
+ 324505 Implement API login
|
||||||
|
|
||||||
jetty-7.2.2.v20101205 5 December 2010
|
jetty-7.2.2.v20101205 5 December 2010
|
||||||
+ JETTY-1308 327109 (re)fixed AJP handling of empty packets
|
+ JETTY-1308 327109 (re)fixed AJP handling of empty packets
|
||||||
|
|
|
@ -27,18 +27,20 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import org.eclipse.jetty.security.Authenticator;
|
import org.eclipse.jetty.security.Authenticator;
|
||||||
import org.eclipse.jetty.security.IdentityService;
|
import org.eclipse.jetty.security.IdentityService;
|
||||||
import org.eclipse.jetty.security.ServerAuthException;
|
import org.eclipse.jetty.security.ServerAuthException;
|
||||||
|
import org.eclipse.jetty.security.UserAuthentication;
|
||||||
import org.eclipse.jetty.server.Authentication;
|
import org.eclipse.jetty.server.Authentication;
|
||||||
|
import org.eclipse.jetty.server.UserIdentity;
|
||||||
import org.eclipse.jetty.util.IO;
|
import org.eclipse.jetty.util.IO;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
|
|
||||||
public class DeferredAuthentication implements Authentication.Deferred
|
public class DeferredAuthentication implements Authentication.Deferred
|
||||||
{
|
{
|
||||||
protected final Authenticator _authenticator;
|
protected final LoginAuthenticator _authenticator;
|
||||||
|
|
||||||
private IdentityService _identityService;
|
private IdentityService _identityService;
|
||||||
private Object _previousAssociation;
|
private Object _previousAssociation;
|
||||||
|
|
||||||
public DeferredAuthentication(Authenticator authenticator)
|
public DeferredAuthentication(LoginAuthenticator authenticator)
|
||||||
{
|
{
|
||||||
if (authenticator == null)
|
if (authenticator == null)
|
||||||
throw new NullPointerException("No Authenticator");
|
throw new NullPointerException("No Authenticator");
|
||||||
|
@ -113,7 +115,10 @@ public class DeferredAuthentication implements Authentication.Deferred
|
||||||
*/
|
*/
|
||||||
public Authentication login(String username, String password)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
Loading…
Reference in New Issue