Login with Yahoo Oauth in php

    Rating: ★★★★☆
    View: 553
    Download: 220
    Từ khóa:

    Before starting with the Yahoo PHP SDK, you will need to register a web application and you will get web-based application ID,OAuth consumer key and secret. These keys will provide you with general access to the Yahoo! Social Platform, and allow your users to authorize your application to access protected resources and information.

    For Creating the Yahoo App,Please Click Here.

    In Yahoo My projects page,Click on the New Project Button.It will appears a popup.In that popup,select the Standard option.

    Yahoo Application Type

    In that Popup click on Continue button after selection of the Yahoo Application type,you will get the Application form.

    Yahoo Application Form

    After filling the all fields,Click on the Get API Key.You will get application ID,OAuth consumer key and secret.

    Yahoo Authentication Information

    After that you need to set the permissions for this app.In the Permissions,You need to select the Read Public option under Social Directory (Profiles) of the Social Directoryand after you need to click on Save and Change Consumer Key.

    Yahoo Application Permissions

    Here is the index.php file.In that file you need to define the OAUTH_CONSUMER_KEY,  OAUTH_CONSUMER_SECRET, OAUTH_DOMAIN, OAUTH_APP_ID

    getSessionedUser();
        // Load the profile for the current user.
        $profile = $user->getProfile();
     
      }
    }
    /**
     * Helper method to close the pop-up window via javascript.
     */
    function close_popup() {
    ?>
    
    
    
    
      
        Login with Yahoo account-Idiot Minds
        
        
        
     
        
     
      
      
        
           
        

    Hi %s!

    ", $profile->image->imageUrl, $profile->profileUrl, $profile->nickname); if($profile->status->message != "") { $statusDate = date('F j, y, g:i a', strtotime($profile->status->lastStatusModified)); echo sprintf("

    %s on %s

    ", $profile->status->message, $statusDate); } echo "

    Logout

    "; } ?>

     

    loading Đang tải...

    template được ưa chuộng