GithubHelp home page GithubHelp logo

easytobook / php-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from loginradius/php-sdk

2.0 6.0 1.0 106 KB

LoginRadius PHP SDK is a development kit that lets you integrate Social Login such as Facebook, Google, Twitter and over 20 more on a PHP website. The SDK also fetches user profile data and can be customized from your LoginRadius user account. Ex: social icon sets, login interface, provider settings, etc.

Home Page: www.LoginRadius.com

PHP 100.00%

php-sdk's Introduction

LoginRadius's PHP SDK is used to implement Social Login on your PHP website

Description: LoginRadius's PHP SDK is a development kit that lets you integrate Social Login through providers such as Facebook, Google, Twitter, and over 20 more on a PHP website. The SDK also fetches user profile data and can be customized from your LoginRadius user account. Ex: social icon sets, login interface, provider settings, etc.

Steps to implement LoginRadius PHP SDK

Step 1: Add SDK file reference to your PHP website

a. Copy the LoginRadius SDK file to your project directory.

b. Include SDK class file on your callback page.

        <?php include('LoginRadiusSDK.php'); ?>

Step 2: Create LoginRadius object in your PHP file

On your callback page, create a LoginRadius object using your unique LoginRadius API Secret.

      <?php 
          $obj = new LoginRadius();
          $userprofile = $obj->construct("Your API Secret key goes here");  
        ?>

Step 3: Validate, authenticate and store data from LoginRadius:

Validate the object using 'IsAuthenticated' variable. After successful validation, access user profile data such as ID, First Name, Last Name, Email using $userprofile->ID, $userprofile->FirstName, $userprofile->LastName, etc.

    <?php  
      $obj = new LoginRadius();  
      $userprofile = $obj->construct("Your API Secret key goes here");  
      if($obj->IsAuthenticated==TRUE)  
        {  
        echo "ID=".$ID=$userprofile->ID."<br>";  
        echo "Provider=".$Provider=$userprofile->Provider."<br>";  
        echo "Prefix=".$Prefix=$userprofile->Prefix."<br>";  
        echo "FirstName=".$FirstName=$userprofile->FirstName."<br>";  
        echo "LastName=".$LastName=$userprofile->LastName."<br>";  
        echo "Suffix=".$Suffix=$userprofile->Suffix."<br>";  
        echo "FullName=".$FullName=$userprofile->FullName."<br>";  
        echo "NickName=".$NickName=$userprofile->NickName."<br>";  
        echo "ProfileName=".$ProfileName=$userprofile->ProfileName."<br>";  
        echo "BirthDate=".$BirthDate=$userprofile->BirthDate."<br>";  
        echo "Gender=".$Gender=$userprofile->Gender."<br>";
        echo "EmailType=".$EmailType=$userprofile->Email[0]->Type."<br>";
        echo "EmailValue=".$EmailValue=$userprofile->Email[0]->Value."<br>";
        echo "Country=".$Country=$userprofile->Country."<br>";
        echo "Provider=".$Provider=$userprofile->Provider."<br>";
        }  
      ?>

Note: Few providers like Twitter, LinkedIn, etc. doesn't provide email address with User Profile data, so you need to handle these cases in your callback page.

These are the quick and easy steps to integrate Social Login on your PHP website, if you have any questions or need a further assistance please contact us at [email protected].

php-sdk's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dianors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.