https://oxpedia.org/wiki/api.php?action=feedcontributions&user=188.99.88.25&feedformat=atomOpen-Xchange - User contributions [en]2024-03-29T12:50:28ZUser contributionsMediaWiki 1.31.0https://oxpedia.org/wiki/index.php?title=FormLogin&diff=9171FormLogin2011-10-14T05:11:00Z<p>188.99.88.25: /* Diagram */</p>
<hr />
<div>= FormLogin =<br />
<br />
The goal here is to authenticate a user for the Open-Xchange system from an external system and to safely pass on the received session data to the userĀ“s browser. To do so the external system has to know the user data (username, password) for Open-Xchange in plain text.<br />
There are three participants in this process: User, Open-Xchange system ("OX") and External system ("3rd-party").<br />
<br />
== Prerequisites ==<br />
<br />
1. A ReverseProxy-directive has to be set in the OX-/Loadbalancer-Apache<br />
<br />
Example: <br />
<br />
#ReverseProxy to 3rd-party to enable the form-login<br />
ProxyPass /forwardname http://3rdpartydomain.tld<br />
ProxyPassReverse /forwardname http://3rdpartydomain.tld<br />
#enable sslProxy<br />
SSLProxyEngine on<br />
<br />
please note that "forwardname" is just an example, this could be anything<br />
<br />
2. The necessary apache-module needs to be installed for this directive to work<br />
<br />
Typically that is done like this:<br />
ln -s /etc/apache2/mods-available/proxy_http.load /etc/apache2/mods-enabled/proxy_http.load<br />
<br />
3. The 3rd-party system accesses the OX-system via the same domainname as the user (e.g. oxdomain.TLD)<br />
<br />
4. the 3rd-party system is on the ip-check-whitelist of the OX-system as described here (in "10.2.20. noipcheck.cnf"):<br />
http://software.open-xchange.com/OX6/doc/OX6-Installation-and-Administration.pdf<br />
<br />
Also the exact parameter-names for the FormLogin can be found here:<br />
http://oxpedia.org/wiki/index.php?title=HTTP_API#Form_Login_.28since_6.20.29<br />
<br />
== Diagram ==<br />
<br />
This diagram shows the complete process. Just read it naturally from top to bottom and you have the chronological order things need to happen in.<br />
<br />
[[File:formLoginDiagram.png]]<br />
<br />
== Example for the login-form ==<br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><br />
<html><br />
<head><br />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><br />
<meta http-equiv="cache-control" content="no-cache"><br />
<title>Login</title><br />
<script type="text/javascript"><br />
function uuid() {<br />
function hex(len, x) {<br />
if (x === undefined) x = Math.random();<br />
var s = new Array(len);<br />
for (var i = 0; i < len; i++) {<br />
x *= 16;<br />
var digit = x & 15;<br />
s[i] = digit + (digit < 10 ? 48 : 87); // '0' and 'a' - 10<br />
}<br />
return String.fromCharCode.apply(String, s);<br />
}<br />
return [hex(8), "-", hex(4), "-4", hex(3), "-", hex(4, 0.5 + Math.random() / 4), "-", hex(12)].join("");<br />
}<br />
</script><br />
</head><br />
<body><br />
<form action="/ajax/login?action=formlogin&authId=" method="post" onSubmit="this.action += uuid();"><br />
<label for="login">Username: </label><br />
<input type="text" name="login" id="login"><br><br />
<label for="password">Password: </label><br />
<input type="password" name="password" id="password"><br><br />
<input type="submit" value="Login"><br />
<input type="hidden" name="client" value="com.openexchange.ox.gui.dhtml"><br />
<input type="hidden" name="version" value="Form Login"><br />
<input type="hidden" name="autologin" value="true"><br />
<input type="hidden" name="uiWebPath" value="/ox6/index.html"><br />
</form><br />
</body><br />
</html></div>188.99.88.25