Welcome Guest, Not a member yet? Register   Sign In
Social Login for Community Auth
#1

Hi 

I am just wondering if anyone managed to integrate any social login library such as https://github.com/LoriKarikari/Social-Codeigniter with the awesome community auth library.
Reply
#2

(06-01-2016, 09:33 PM)cytey Wrote: Hi 

I am just wondering if anyone managed to integrate any social login library such as https://github.com/LoriKarikari/Social-Codeigniter with the awesome community auth library.

I use HybridAuth, integrate Codeigniter 3.06 without issue.

Check out this.
https://github.com/andacata/HybridIgniter
Personal blog: https://terryl.in
My personal project is called Dictpedia is currently using Codeigniter 3, welcome.
Reply
#3

(This post was last modified: 06-05-2016, 04:08 PM by skunkbad. Edit Reason: More info )

I took some time to implement a feature that allows you to skip Community Auth's regular checks for authentication and force somebody to be logged in. This should allow you to use another service for your user's authentication, but tell Community Auth / CodeIgniter that they are logged in.

Whatever service you use to authenticate externally, you will need to get the username or email address once the user is deemed to be logged in. Once you have that, you can do something like this:


PHP Code:
// Add the username or email address of the user you want logged in:
$username_or_email_address '';

if( ! empty( 
$username_or_email_address ) )
{
    $auth_model $this->authentication->auth_model;

    // Get normal authentication data using username or email address
    if( $auth_data $this->{$auth_model}->get_auth_data$username_or_email_address ) )
    {
        /**
         * If redirect param exists, user redirected there.
         * This is entirely optional, and can be removed if 
         * no redirect is desired.
         */
        
$_GET['redirect'] = 'somewhere';
        $this->authentication->redirect_after_login();

        // Set auth related session / cookies
        $this->authentication->maintain_state$auth_data );
    }
}
else
{
    echo 'Example requires that you set a username or email address.';


This functionality added today, 6/5/2016 and tagged v3.1.2
Reply
#4

hybrid-auth and codeigniter cool.
bookmarked.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB