I know I’m opening an old thread here, but how does the first poster’s example integrate with loginviapost?
The example form is purely to execute the standard nextcloud login and bypasses external origin etc.
so in essence: the form below when posted works perfectly and logs the user in
<form method="post" action="https://domain.co.uk/index.php/apps/loginviapost/login">
<input type="text" name="username" />
<input type="text" name="password" />
<input type="submit" value="Submit" />
whereas executing via code as below does nothing and if I subsequently go the files page I just get the log in page.
$data = array(
'username' => 'username',
'password' => 'password'
$postvars = http_build_query($data) . "\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://domain.co.uk/index.php/apps/loginviapost/login');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
Do you have sample code which runs an external login and also the nextcloud in one shot please? this would be great as it’s the last missing piece of my solution puzzle!