blob: 794e1a8539ea522a1904a90129e7065f6004c264 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
/*
* Copyright 2013 Jesse Morgan
*/
package com.p4square.session;
import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.security.Authenticator;
import org.restlet.security.User;
/**
*
* @author Jesse Morgan <jesse@jesterpm.net>
*/
public class SessionAuthenticator /*extends Authenticator*/ {
/*
@Override
protected boolean authenticate(Request request, Response response) {
// Check for authentication cookie
final String cookie = request.getCookies().getFirstValue(COOKIE_NAME);
if (cookie != null) {
cLog.debug("Got cookie: " + cookie);
// TODO Decrypt user info
User user = new User(cookie);
request.getClientInfo().setUser(user);
return true;
}
// Challenge the user if not authenticated
response.redirectSeeOther(mLoginPage);
return false;
}
*/
}
|