Facebook strategy for Opauth

Overview

Opauth-Facebook

Opauth strategy for Facebook authentication.

Implemented based on https://developers.facebook.com/docs/authentication/

Getting started

  1. Install Opauth-Facebook:

    cd path_to_opauth/Strategy
    git clone https://github.com/opauth/facebook.git Facebook

    or

    composer require opauth/facebook
    
  2. Create Facebook application at https://developers.facebook.com/apps/

    • Remember to enter App Domains
    • "Website with Facebook Login" must be checked, but for "Site URL", you can enter any landing URL.
  3. Configure Opauth-Facebook strategy with at least App ID and App Secret.

  4. Direct user to http://path_to_opauth/facebook to authenticate

Strategy configuration

Required parameters:

<?php
'Facebook' => array(
	'app_id' => 'YOUR APP ID',
	'app_secret' => 'YOUR APP SECRET'
)

Even though fields is an optional configuration parameter for Opauth-Facebook, for most cases you would like to explicitly define it. It should be defined in a comma-separated string.

Refer to Facebook Fields Reference for list of valid fields.

License

Opauth-Facebook is MIT Licensed
Copyright © 2012 U-Zyn Chua (http://uzyn.com)

Comments
  • Undefined index: expires @ line 77

    Undefined index: expires @ line 77

    After login i have this error :

    [ Notice ]: Undefined index: expires
    /vendor/opauth/lib/Opauth/Strategy/Facebook/FacebookStrategy.php @ line 77
    

    It's at line 77. For info, Twitter and Google opauth's work fine

    opened by jhuriez 8
  • Intermittent warning with file_get_contents() OpauthStrategy.php, line 402

    Intermittent warning with file_get_contents() OpauthStrategy.php, line 402

    Hello,

    I have a strange problem using OpAuth's Facebook strategy.

    The strategy works correctly, I can connect via Facebook, but sometime I get this warning:

    Warning (2): file_get_contents(https://graph.facebook.com/oauth/access_token?client_id=xxxxxx&client_secret=xxxxxxxx&redirect_uri=http%3A%2F%2Fdev.example.com%2Fauth%2Ffacebook%2Fint_callback&code=AQD5Rkdrhw4J_VRxH72N4R3eWUTO_ItVnY7X3EvQ-f2hAiQboKPv4IHowpk4AU6JJX6wFUc0PnaaItYbeVKtm9uQVWdQdmgXFz47aNI5EtmP_QT8RJIfU35nmhSLzSSE9aH3NZBm0RngUeEyq8-hLOyyhUDZy1-qGZaWyBdzZ3p6aIF193y6TuOxfjYvZfaiz1BEY35HPASCvqb_u9fooOuJIqBCo3qtbS5wgwPbcD6dqE0k3D0WfPJCskYg3KfHYhdbGej1w8fzDJrRvpvpNrWPXw03-m2-Xauj3CtQLO5xxBmfbCRV2keonrg330uIHyk): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
     [APP/Plugin/Opauth/Vendor/Opauth/lib/Opauth/OpauthStrategy.php, line 402]
    Code Context
    file_get_contents - [internal], line ??
    OpauthStrategy::httpRequest() - APP/Plugin/Opauth/Vendor/Opauth/lib/Opauth/OpauthStrategy.php, line 402
    OpauthStrategy::serverGet() - APP/Plugin/Opauth/Vendor/Opauth/lib/Opauth/OpauthStrategy.php, line 353
    FacebookStrategy::int_callback() - APP/Plugin/Opauth/Strategy/Facebook/FacebookStrategy.php, line 61
    OpauthStrategy::callAction() - APP/Plugin/Opauth/Vendor/Opauth/lib/Opauth/OpauthStrategy.php, line 188
    Opauth::run() - APP/Plugin/Opauth/Vendor/Opauth/lib/Opauth/Opauth.php, line 117
    OpauthAppController::index() - APP/Plugin/Opauth/Controller/OpauthAppController.php, line 31
    ReflectionMethod::invokeArgs() - [internal], line ??
    Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 486
    Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 187
    Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 162
    [main] - APP/webroot/index.php, line 92
    
    opened by dall 5
  • Remove nickname and change name to name

    Remove nickname and change name to name

    Facebook has deprecated the username in the new version 2.0 of the Graph Api, so Opauth is throwing an error Invalid response, missing required parameters.

    https://developers.facebook.com/docs/apps/changelog

    opened by joecohens 3
  • Second connect

    Second connect

    If we try to connect for the second time using Opauth for Facebook (when we already connected), to extend access token. Facebook won't return expires value.

    FacebookStrategy.php:76 will return an error because expires is not set in results

    opened by meznaric 3
  • Facebook folder is ignored by git

    Facebook folder is ignored by git

    Hello...

    I have encountered this problem while using Opauth Facebook.

    I cloned this repository into the Strategy folder just like what is instructed in README file.

    However, the Facebook folder is seemed to be ignored by git. I was not able to push it into my project. I tried checking gitignore files, but it is not included in gitignore.

    Can anyone help me regarding this issue? Thank you so much in advance!

    opened by lorimay21 2
  • Process 'middle_name' element

    Process 'middle_name' element

    Some people have a middle_name, like me.

    First name: Kees middle name: van Last name: Dieren

    When I login using Facebook, the 'info' hash contains:

            [info] => Array
                (
                    [name] => Kees van Dieren
                    [image] => ...
                    [nickname] => ....
                    [first_name] => Kees
                    [last_name] => Dieren
                    [urls] => Array
                        (
                            [facebook] => ...
                        )
    
                )
    

    The middle_name is not present in info.

    Solutions could be:

    • add a middle_name key to info hash
    • add middle_name as suffix to last name, e.g. making last_name 'van Dieren'
    opened by keesvandieren 2
  • Update to API Version 6.0

    Update to API Version 6.0

    API 2.12 will be retired soon. We compared responses from Facebook using API 2.12 and API 6.0 (the latest version) ==> We found no differences in the responses.

    opened by nielsWerstreamtEs 1
  • fix error callback without error message

    fix error callback without error message

    Sometimes Facebook send errors without 'error_message', as result we have messages in the logs like this: PHP Notice: Undefined index: error_message in /var/www/website/vendor/opauth/facebook/FacebookStrategy.php on line 59

    opened by Junker 1
  • Error keys for Error-Callback wrong

    Error keys for Error-Callback wrong

    The FacebookStrategy::int_callback() method fails when there is an error as the response keys are still at the old API. This concerns v0.3 of this package. PR ahead.

    opened by franz-josef-kaiser 1
  • Facebook Strategy

    Facebook Strategy

    In the functionprivate function me it´s necessary put other parameter to get the email

    $me = $this->serverGet('https://graph.facebook.com/me', array('access_token' => $access_token,'fields' => 'id,name,email' ), null, $headers);

    opened by quiquisolis 1
  • Facebook platform OAuth 2.0 is upgraded

    Facebook platform OAuth 2.0 is upgraded

    I have upgraded OAuth version 2.0 in my local repo as per the facebook doc https://developers.facebook.com/docs/apps/upgrading and its works fine for me. @uzyn please review and merge this PR.

    opened by ghost 1
Owner
Opauth – PHP Auth Framework
Opauth – PHP Auth Framework
Opauth strategy for Google authentication

Opauth-Google Opauth strategy for Google authentication.

Opauth – PHP Auth Framework 84 Dec 4, 2022
Open source social sign on PHP Library. HybridAuth goal is to act as an abstract api between your application and various social apis and identities providers such as Facebook, Twitter and Google.

Hybridauth 3.7.1 Hybridauth enables developers to easily build social applications and tools to engage websites visitors and customers on a social lev

hybridauth 3.3k Dec 23, 2022
via this package you can push notifications to [ Facebook , Twitter , Telegram , Linkedin ] ( Laravel )

Push To Social [ Facebook , Twitter , Telegram , Linkedin ] via this package you can push notifications to [ Facebook , Twitter , Telegram , Linkedin

Peter Tharwat 29 Nov 4, 2022
Login Menggunakan Google, Github, & Facebook

Login Oauth 2 Karena agak rumit untuk menjelaskan, ikuti tutorial berikut untuk mengatur CLIENTID dan CLIENTSECRET mu terlebih dahulu klik. Server Req

Fadhlurrahman 1 Nov 24, 2021
Tool termux untuk crack akun Facebook.

Facebook Cracker Elite Tool termux untuk crack akun Facebook. Cara Install Install cURL dan PHP untuk termux pkg up && pkg install curl && pkg ins

Ihsan Devs 3 Oct 20, 2022
Symfony bundle to publish status updates on Facebook, LinkedIn and Twitter.

Upgrading? Check the upgrade guide. What's this? This is a Symfony bundle written in PHP 7.1 that wraps martin-georgiev/social-post - an easy way for

Martin Georgiev 37 Oct 30, 2022
Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban

Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban

安正超 330 Nov 14, 2022
Creamos un inicio de sesión desde Facebook para nuestra aplicación web utilizando la librería de Socialite

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Carlos Villatoro 2 May 23, 2022
Facebook strategy for Opauth

Opauth-Facebook Opauth strategy for Facebook authentication. Implemented based on https://developers.facebook.com/docs/authentication/ Getting started

Opauth – PHP Auth Framework 89 Dec 4, 2022
Opauth strategy for Google authentication

Opauth-Google Opauth strategy for Google authentication.

Opauth – PHP Auth Framework 84 Dec 4, 2022
a tool to get Facebook data, and some Facebook bots, and extra tools found on Facebook Toolkit ++.

FACEBOOK TOOLKIT a tool to get Facebook data, and some Facebook bots, and extra tools found on Facebook Toolkit ++. Graph API Facebook. Made with ❤️ b

Wahyu Arif Purnomo 569 Dec 27, 2022
The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login

Facebook SDK for PHP (v5) This repository contains the open source PHP SDK that allows you to access the Facebook Platform from your PHP app. Installa

Meta Archive 3.1k Dec 30, 2022
Facebook Query Builder: A query builder for nested requests in the Facebook Graph API

A query builder that makes it easy to create complex & efficient nested requests to Facebook's Graph API to get lots of specific data back with one request.

Sammy Kaye Powers 92 Dec 18, 2022
Facebook SDK for PHP (v6) - allows you to access the Facebook Platform from your PHP app

Facebook SDK for PHP (v6) This repository contains the open source PHP SDK that allows you to access the Facebook Platform from your PHP app. Installa

null 0 Aug 10, 2022
A back-off strategy interface for retrying operations.

EventSauce BackOff This library provides an interface for encapsulated back-off strategies. composer require eventsauce/backoff Leveraging the back-of

EventSauce 59 Dec 19, 2022
🚀 An open source multiplayer space strategy game.

Badges Introduction The game story takes place in a virtual galaxy where randomly generated planets produce various raw materials which can be used by

Galaxy of Drones Online 192 Dec 25, 2022
A text-based, persistent browser-based strategy game (PBBG) in a fantasy war setting

Note: OpenDominion is still in development. Some features of the game have not been implemented yet. Introduction OpenDominion is a free and open-sour

null 180 Dec 28, 2022
MeowOfDuty - An open source multiplayer space strategy game

The game story takes place in a virtual galaxy where randomly generated planets produce various raw materials which can be used by the Players to develop their infrastructure and fleet. In addition, players may trade with the Earth or engage in battles, so beyond various military arrangements, economic decisions should be taken as well.

@stux 3 Jun 27, 2022
Open source social sign on PHP Library. HybridAuth goal is to act as an abstract api between your application and various social apis and identities providers such as Facebook, Twitter and Google.

Hybridauth 3.7.1 Hybridauth enables developers to easily build social applications and tools to engage websites visitors and customers on a social lev

hybridauth 3.3k Dec 23, 2022
Laravel wrapper for Facebook's GraphQL

Laravel GraphQL Use Facebook's GraphQL with Laravel 6.0+. It is based on the PHP port of GraphQL reference implementation. You can find more informati

Mikk Mihkel Nurges 1.9k Dec 31, 2022