We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Extern Login Form with FB Connect | Forum

Topic location: Forum home » Support » General Questions
Dev
Dev Aug 14 '17
Hello,


i need a extern Login Form to Login in Oxwall. Also with the Facebook-Connect Login, if is it possibile.


Can I use REST API for the authentification or how can i do this?


Thank you

Dev
Dev Aug 14 '17
I tried this:

<?php
define('OW_URL_HOME', 'http://localhost/oxwall_new/index.php');
define('_OW_', true);

define('DS', DIRECTORY_SEPARATOR);

define('OW_DIR_ROOT', dirname(__FILE__) . DS);
require_once(OW_DIR_ROOT . 'ow_includes' . DS . 'init.php');
require_once(OW_DIR_ROOT . 'ow_system_plugins' . DS . 'base/classes/standard_auth.php');
require_once(OW_DIR_ROOT . 'ow_core' . DS . 'session.php');
$username = $_GET['username'];
$password = $_GET['password'];


$adapter = new BASE_CLASS_StandardAuth($username,$password);
$result = OW::getUser()->authenticate($adapter, true);
     
                if ( $result->isValid() )
                {
                    if ( isset($data['remember']) )
                    {
                        $loginCookie = $this->userService->saveLoginCookie(OW::getUser()->getId());
     
                        setcookie('ow_login', $loginCookie->getCookie(), (time() + 86400 * 7), '/', null, null, true);
                    }
           
                }
   
session_regenerate_id();     

header('Location:http://localhost/oxwall_new/index.php')
?>

But the line


$result = OW::getUser()->authenticate($adapter, true);


is not working ....


what can i do?

Ebenezer from Bluetide Webs
I did something quite similar... I will look and see if I can come up with something.
dev_kommunikatisten
dev_kommunikatisten Aug 16 '17
Is there an solution for the extern login form with FB Connect and Forgot PW?

it should be possible to build such a form on a extern URL with a script on the own Oxwall-Page like Ajax login or with the Oxwall API?


Thank you
dev_kommunikatisten
dev_kommunikatisten Aug 17 '17
is it possible to check the username / pass with a own php script ... so i get the UserID from the user-table

but how kann i register the user in the oxwall system (like a normal login) ?