Hybrid Auth with Codeigniter

I downloaded the codeigniter extension of HybridAuth here:


I followed instructions on its use. When I try to login via any provider at: www.mydomainname.com/hauth/login/twitter it loads a page saying:

Open Source Social Sign On PHP Library. 

It never works. I have valid API credentials for Twitter and Facebook but both load this page and nothing else happens. Any tips would be greatly appreciated.


My log says:

Hybrid_Provider_Adapter::login( facebook ), redirect the user to login_start URL. -- Array
    [hauth_return_to] => http://www.sitename.com/hauth/login/facebook
    [hauth_token] => 6vjglu8usmsjqsi74cku8o85j3
    [hauth_time] => 1335997302
    [login_start] => http://sitename.com/hauth/endpoint?hauth.start=facebook&hauth.time=1335997302
    [login_done] => http://sitename.com/hauth/endpoint?hauth.done=facebook

INFO -- -- 2012-05-03T00:21:42+02:00 -- Enter Hybrid_Auth::redirect( http://sitename.com/hauth/endpoint?hauth.start=facebook&hauth.time=1335997302, PHP )


Here is a link to the controller



here is my code which work 100% :

class Auth extends MX_Controller {

    public function __construct()


    //social login
    public function social($provider)
            $serviceEnabled = $this->hybridauthlib->serviceEnabled($provider);
            if ($serviceEnabled)

                $this->service = $this->hybridauthlib->authenticate($provider);
                if ($this->service->isUserConnected())
                    $user_profile = $this->service->getUserProfile();
                    if($this->auth_model->count_user_by_uid($user_profile->identifier) === 0)
                        $this->session->set_flashdata('message','You Dont have account.. Create one.');
                        $dump_data = $this->auth_model->get_by(array('provider_uid'=>$user_profile->identifier));
                        $user = $this->ion_auth->user($dump_data->user_id)->row();

                        $session_data = array(
                            'identity'             => $user->{$this->config->item('identity', 'ion_auth')},
                            'username'             => $user->username,
                            'email'                => $user->email,
                            'user_id'              => $user->id, //everyone likes to overwrite id so we'll use user_id
                            'old_last_login'       => $user->last_login


                        $this->ion_auth->clear_login_attempts($this->config->item('identity', 'ion_auth'));


                        if ($this->config->item('remember_users', 'ion_auth'))

                        $this->ion_auth->trigger_events(array('post_login', 'post_login_successful'));
                else // Cannot authenticate user
                    $this->session->set_flashdata('message','Cannot authenticate user');

            else // This service is not enabled.
                $this->session->set_flashdata('message','This providers is not enabled.');
        catch(Exception $e)
            $error = 'Unexpected error';
                case 0 : $error = 'Unspecified error.'; break;
                case 1 : $error = 'Hybriauth configuration error.'; break;
                case 2 : $error = 'Provider not properly configured.'; break;
                case 3 : $error = 'Unknown or disabled provider.'; break;
                case 4 : $error = 'Missing provider application credentials.'; break;
                case 5 : log_message('debug', 'controllers.HAuth.login: Authentification failed. The user has canceled the authentication or the provider refused the connection.');
                         if (isset($service))
                         $error = 'User has cancelled the authentication or the provider refused the connection.';
                case 6 : $error = 'User profile request failed. Most likely the user is not connected to the provider and he should to authenticate again.';
                case 7 : $error = 'User not connected to the provider.';

            if (isset($this->service))
            log_message('error', 'controllers.HAuth.login: '.$error);
            $this->session->set_flashdata('message', $error);
            redirect('/users/auth/login/', 'refresh');          


    public function endpoint()
        log_message('debug', 'controllers.HAuth.endpoint called.');
        log_message('info', 'controllers.HAuth.endpoint: $_REQUEST: '.print_r($_REQUEST, TRUE));

        if ($_SERVER['REQUEST_METHOD'] === 'GET')
            log_message('debug', 'controllers.HAuth.endpoint: the request method is GET, copying REQUEST array into GET array.');
            $_GET = $_REQUEST;

        log_message('debug', 'controllers.HAuth.endpoint: loading the original HybridAuth endpoint script.');
        require_once ADDONPATH.'/users/third_party/hybridauth/index.php'; //ADDONPATH is my modules path

i hope that you can find it useful. am using the ion_auth for the main login system. the auth_model is a small model which check if the user has enabled this provider with name or not, since i want the user to have the same data even if he use another social network to login with ..

the above answer didn't help much to me but i figured out the problem.

Add index.php to base_url in config/hybridauthlib.php

'base_url' => '/index.php/hauth/endpoint',

Need Your Help

Django and PHP simultaneous use

php python django apache

I have an Apache server with PHP support. I also installed Python with mod_wsgi and with mysql-connector. Besides I installed Django. Now, I want to try to use PHP and Python simultaneously at the ...

Flex mobile How to change App name?

flex flexbuilder flex4.5

When i finish building my program into an app and install it, the app name (appear below its icon) is call "Main".