diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2016-04-09 14:22:20 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2016-04-09 15:48:01 -0700 |
commit | 3102d8bce3426d9cf41aeaf201c360d342677770 (patch) | |
tree | 38c4f1e8828f9af9c4b77a173bee0d312b321698 /src/com/p4square/session/SessionCreatingAuthenticator.java | |
parent | bbf907e51dfcf157bdee24dead1d531122aa25db (diff) |
Switching from Ivy+Ant to Maven.
Diffstat (limited to 'src/com/p4square/session/SessionCreatingAuthenticator.java')
-rw-r--r-- | src/com/p4square/session/SessionCreatingAuthenticator.java | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/com/p4square/session/SessionCreatingAuthenticator.java b/src/com/p4square/session/SessionCreatingAuthenticator.java deleted file mode 100644 index 3ec14b4..0000000 --- a/src/com/p4square/session/SessionCreatingAuthenticator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2013 Jesse Morgan - */ - -package com.p4square.session; - -import org.apache.log4j.Logger; - -import org.restlet.Context; -import org.restlet.Request; -import org.restlet.Response; -import org.restlet.security.Authenticator; -import org.restlet.security.User; - -/** - * Authenticator which creates a Session for the request and adds a cookie - * to the response. - * - * The Request MUST be Authenticated and MUST have a User object associated. - * - * @author Jesse Morgan <jesse@jesterpm.net> - */ -public class SessionCreatingAuthenticator extends Authenticator { - private static final Logger LOG = Logger.getLogger(SessionCreatingAuthenticator.class); - - public SessionCreatingAuthenticator(Context context) { - super(context, true); - } - - protected boolean authenticate(Request request, Response response) { - if (Sessions.getInstance().get(request) != null) { - return true; - } - - User user = request.getClientInfo().getUser(); - - if (request.getClientInfo().isAuthenticated() && user != null) { - Sessions.getInstance().create(request, response); - LOG.debug(response); - return true; - } - - return false; - } - -} |