Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8133427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:36:12+00:00 2026-06-06T09:36:12+00:00

I downloaded the codeigniter extension of HybridAuth here: https://github.com/andacata/HybridIgniter I followed instructions on its

  • 0

I downloaded the codeigniter extension of HybridAuth here:

https://github.com/andacata/HybridIgniter

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:

HybridAuth
Open Source Social Sign On PHP Library. 
hybridauth.sourceforge.net/

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.

UPDATE

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 -- 127.0.0.1 -- 2012-05-03T00:21:42+02:00 -- Enter Hybrid_Auth::redirect( http://sitename.com/hauth/endpoint?hauth.start=facebook&hauth.time=1335997302, PHP )

UPDATE

Here is a link to the controller

https://github.com/andacata/HybridIgniter/blob/master/application/controllers/hauth.php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T09:36:13+00:00Added an answer on June 6, 2026 at 9:36 am

    here is my code which work 100% :

    class Auth extends MX_Controller {
    
        public function __construct()
        {
            parent::__construct();
            $this->template->set_layout('login');
    
        }
    
        //social login
        public function social($provider)
        {
            try{
                $this->load->library('HybridAuthLib');
                $this->load->model('auth_model');
                $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.');
                            redirect('/users/register','refresh');
                        }
                        else
                        {
                            $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->update_last_login($user->id);
    
                            $this->ion_auth->clear_login_attempts($this->config->item('identity', 'ion_auth'));
    
                            $this->session->set_userdata($session_data);
    
                            if ($this->config->item('remember_users', 'ion_auth'))
                            {
                                $this->ion_auth->remember_user($user->id);
                            }
    
                            $this->ion_auth->trigger_events(array('post_login', 'post_login_successful'));
                            $this->ion_auth->set_message('login_successful');
                            redirect('/','refresh');
                        }
                    }
                    else // Cannot authenticate user
                    {
                        $this->session->set_flashdata('message','Cannot authenticate user');
                        redirect('/users/auth/login/','refresh');
                    }
    
                }
                else // This service is not enabled.
                {
                    $this->session->set_flashdata('message','This providers is not enabled.');
                    redirect('/users/auth/login/','refresh');
                }
            }
            catch(Exception $e)
            {
                $error = 'Unexpected error';
                switch($e->getCode())
                {
                    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.');
                             //redirect();
                             if (isset($service))
                             {
                                $service->logout();
                             }
                             $error = 'User has cancelled the authentication or the provider refused the connection.';
                             break;
                    case 6 : $error = 'User profile request failed. Most likely the user is not connected to the provider and he should to authenticate again.';
                             break;
                    case 7 : $error = 'User not connected to the provider.';
                             break;
                }
    
                if (isset($this->service))
                {
                    $this->service->logout();
                }
                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 ..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the recaptcha with CodeIgniter. I followed some online instructions and
I'm trying out codeIgniter and the Modular Extension. So far I followed the installation
I downloaded the sample ASP.NET login page from here: https://wiki.jasig.org/display/CASC/ASP.NET+Forms+Authentication And got CAS working
I have just downloaded and unpacked Codeigniter 2.1 and put its contents into a
I downloaded a project from TouchMyPixel and when I try to run it with
I downloaded Mono software (http://xamarin.com/monoforandroid) and the samples from the xamarin website (http://samples.xamarin.com/Android). When
I download CodeIgniter 2.1.0 and I followed the tutorial on CodeIgniter 2.1.0. The problem
I downloaded Netbeans and CodeIgniter, and I downloaded 2 plugins for Netbeans. On of
Question about this helper http://codeigniter.com/user_guide/helpers/download_helper.html If, for example, program.exe weights 4 GB, will it
I downloaded the last version of CodeIgniter and I tried to run a simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.