Roundcube Community Forum

 

Minimal Login Page

Started by AngelDeLaNoche, July 25, 2011, 05:47:27 PM

Previous topic - Next topic

AngelDeLaNoche

We have a web site that is loaded from multiple domain names.  I am trying to create a minimal login page that is loaded in an iframe on the main page.  The iframe passes the domain name to the login page in the frame.  The login page then adds the domain to the users account when they login.  My small login page submits the data to the roundcube login.  As far as I can tell, the data is being passed correctly, but I get an error on the roundcube login page, "Invalid request! No data was saved."

From the index page:

$DomainName = $_SERVER['HTTP_HOST'];
echo "";
?>

smalllogin.php:

$DomainName = $_GET["domain"];
?>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">














         













Use classic interface.";?>




SKaero

You'll need to implement a login plugin in RoundCube to login, take a look at autologon.php in trunk/plugins/autologon as an example.

rosali

To clarify: Roundcube has a built in CSFR prevention. Each page gets a unique token which is cross checked when submitting a form or triggering an AJAX-Request. If the token does not match the 'Invalid request ...' error is raised. To around this you have to disable CSFR prevention. As skaero stated the autologon plugin is a good starting point.
Regards,
Rosali

AngelDeLaNoche

Turns out we have that plugin on the server already, but don't know what to do with it.

rosali

autologon plugin is a framework (proof of concept) for your own coding.
Regards,
Rosali