Open-Xchange servlet for external login masks

Revision as of 08:36, 21 June 2011 by Tierlieb (talk | contribs) (linked detail article, added categories)

Open-Xchange servlet for external login masks

Note: This document describes the new mechanism as introduced with 6.20. This is the old version.

Who should read this document

This document is written for web developers who would like to create a custom login mask for the Open-Xchange server. The login mask can reside on an external server i. e., not directly located in the domain of the Open-Xchange machines. It is also intended for administrators who install and maintain Open-Xchange services.

Description

The Open-Xchange HTTP API has a function to create a session from external.

In order for this mechanism to work, you need to set com.openexchange.sessiond.autologin=true in /opt/open-xchange/etc/groupware/sessiond.properties

Example form

A recent version of this sample can be found in the open-xchange package within the directory in /usr/share/doc.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="cache-control" content="no-cache">
<title>Login</title>
<script type="text/javascript">
function uuid() {
    function hex(len, x) {
        if (x === undefined) x = Math.random();
        var s = new Array(len);
        for (var i = 0; i < len; i++) {
            x *= 16;
            var digit = x & 15;
            s[i] = digit + (digit < 10 ? 48 : 87); // '0' and 'a' - 10
        }
        return String.fromCharCode.apply(String, s);
    }
    return [hex(8), "-", hex(4), "-4", hex(3), "-", hex(4, 0.5 + Math.random() / 4), "-", hex(12)].join("");
}
</script>
</head>
<body>
<form action="/ajax/login?action=formlogin&authId=" method="post" onSubmit="this.action += uuid();">
<p>
<label for="login">Username: </label>
<input type="text" name="login" id="login"><br>
<label for="password">Password:  </label>
<input type="password" name="password" id="password"><br>
<input type="submit" value="Login">
<input type="hidden" name="client" value="com.openexchange.ox.gui.dhtml">
<input type="hidden" name="version" value="Form Login">
<input type="hidden" name="autologin" value="true">
<input type="hidden" name="uiWebPath" value="/ox6/index.html">
</p>
</form>
</body>
</html>

More

See OXSessionFormLogin for details on the API and find out about what every parameter does and how to handle errors.