|
boolean | itsMe (String id) |
|
boolean | myTurn (HttpServletRequest request) |
|
void | execute (ServletContext context, HttpServletRequest request, HttpServletResponse response) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 44 of file AuthActions.java.
◆ createLogoutURL()
static String org.turro.auth.AuthActions.createLogoutURL |
( |
String |
redir | ) |
|
|
static |
Definition at line 68 of file AuthActions.java.
69 IContact contact = Authentication.getLoggedIContact();
70 if(contact !=
null && contact.isValid()) {
71 return DirectContents.createRelativeURL(
getIdentifier()) + LOGOUT_URL +
72 (redir !=
null ?
"?redir=" + redir :
"");
static String getIdentifier()
◆ execute()
void org.turro.auth.AuthActions.execute |
( |
ServletContext |
context, |
|
|
HttpServletRequest |
request, |
|
|
HttpServletResponse |
response |
|
) |
| |
Implements org.turro.elephant.direct.IDirectContent.
Definition at line 113 of file AuthActions.java.
114 if(DirectContents.isYourTurn(request,
getIdentifier() + LOGOUT_URL)) {
115 String redir = request.getParameter(
"redir");
117 Authentication.doLogout(redir);
118 }
catch (IOException ex) {
119 Logger.getLogger(AuthActions.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
121 }
else if(DirectContents.isYourTurn(request,
getIdentifier() + AUTH_URL)) {
124 String url = createAccessURL(request);
125 if(!Strings.isBlank(url)) {
126 ElephantResponse.writeToResponse(response, ElephantResponseType.RESPONSE_CORRECT,
129 }
catch (IOException ex) {
130 Logger.getLogger(AuthActions.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static boolean isTrustedSource(HttpServletRequest request)
◆ getAccessURL()
static String org.turro.auth.AuthActions.getAccessURL |
( |
String |
domain, |
|
|
String |
email, |
|
|
String |
redir |
|
) |
| |
|
static |
Definition at line 50 of file AuthActions.java.
52 ElephantPost ep =
new ElephantPost(DirectContents.createURL(domain,
getIdentifier()) + AUTH_URL);
53 if(!email.contains(
"@")) {
56 ep.addParameter(
"email", email);
57 ep.addParameter(
"redir", redir);
58 ElephantResponse er = ep.doPost();
59 if(ElephantResponse.isCorrect(er)) {
60 return domain +
"?" + er.message;
62 }
catch (IOException ex) {
63 Logger.getLogger(AuthActions.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static String mapName(String name)
◆ getIdentifier()
static String org.turro.auth.AuthActions.getIdentifier |
( |
| ) |
|
|
static |
Definition at line 98 of file AuthActions.java.
99 return AuthActions.class.getAnnotation(DirectContent.class).identifier();
◆ isTrustedSource()
static boolean org.turro.auth.AuthActions.isTrustedSource |
( |
HttpServletRequest |
request | ) |
|
|
static |
Definition at line 78 of file AuthActions.java.
79 String remoteIP = request.getRemoteAddr();
80 if(
"127.0.0.1".equals(remoteIP))
return true;
81 if(ElephantProperties.containsContextProperty(
"trusted",
"trusted")) {
82 Logger.getLogger(AuthActions.class.getName()).log(Level.INFO, remoteIP +
" trust checked");
83 return ElephantProperties.getContextProperty(
"trusted",
"trusted",
"").contains(remoteIP);
◆ itsMe()
boolean org.turro.auth.AuthActions.itsMe |
( |
String |
id | ) |
|
◆ mapName()
static String org.turro.auth.AuthActions.mapName |
( |
String |
name | ) |
|
|
static |
Definition at line 88 of file AuthActions.java.
89 if(ElephantProperties.containsContextProperty(
"user-map", name)) {
90 Logger.getLogger(AuthActions.class.getName()).log(Level.INFO, name +
" mapped");
91 return ElephantProperties.getContextProperty(
"user-map", name);
93 Logger.getLogger(AuthActions.class.getName()).log(Level.INFO, name +
" not found");
◆ myTurn()
boolean org.turro.auth.AuthActions.myTurn |
( |
HttpServletRequest |
request | ) |
|
The documentation for this class was generated from the following file: