GithubHelp home page GithubHelp logo

laravel / socialite Goto Github PK

View Code? Open in Web Editor NEW
5.5K 5.5K 935.0 677 KB

Laravel wrapper around OAuth 1 & OAuth 2 libraries.

Home Page: https://laravel.com/docs/socialite

License: MIT License

PHP 100.00%
laravel oauth

socialite's Introduction

Logo Laravel Socialite

Build Status Total Downloads Latest Stable Version License

Introduction

Laravel Socialite provides an expressive, fluent interface to OAuth authentication with Facebook, Twitter, Google, LinkedIn, GitHub, GitLab and Bitbucket. It handles almost all of the boilerplate social authentication code you are dreading writing.

We are not accepting new adapters.

Adapters for other platforms are listed at the community driven Socialite Providers website.

Official Documentation

Documentation for Socialite can be found on the Laravel website.

Contributing

Thank you for considering contributing to Socialite! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

Laravel Socialite is open-sourced software licensed under the MIT license.

socialite's People

Contributors

aaronpk avatar adamgoose avatar alihamze avatar barryvdh avatar bostjanob avatar browner12 avatar carusogabriel avatar crynobone avatar cupoftea696 avatar derekmd avatar driesvints avatar everywell avatar georgecoca avatar grahamcampbell avatar hareku avatar iliyazelenko avatar isaackearl avatar it-can avatar jdrzejb avatar joecohens avatar kerryjones avatar lucasmichot avatar luiz-brandao avatar max13 avatar ntzm avatar nunomaduro avatar sammyk avatar stylecibot avatar taylorotwell avatar teertz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

socialite's Issues

Socialize v4.1 not install on laravel 5.5

  • Socialite Version: 4.1.2
  • Laravel Version: 5.5.*
  • PHP Version: 7.3

Description:

─ $ ▶  composer require laravel/socialite
Using version ^4.1 for laravel/socialite
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove laravel/framework v5.5.45
    - Conclusion: don't install laravel/framework v5.5.45
    - laravel/socialite 4.1.1 requires illuminate/http ~5.7.0|~5.8.0 -> satisfiable by illuminate/http[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.2, v5.8.3, v5.8.4, v5.8.8, v5.8.9].
    - laravel/socialite v4.1.0 requires illuminate/http ~5.7.0|~5.8.0 -> satisfiable by illuminate/http[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.2, v5.8.3, v5.8.4, v5.8.8, v5.8.9].
    - laravel/socialite v4.1.2 requires illuminate/http ~5.7.0|~5.8.0 -> satisfiable by illuminate/http[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.2, v5.8.3, v5.8.4, v5.8.8, v5.8.9].
    - laravel/socialite v4.1.3 requires illuminate/http ~5.7.0|~5.8.0|~5.9.0 -> satisfiable by illuminate/http[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.2, v5.8.3, v5.8.4, v5.8.8, v5.8.9].
    - don't install illuminate/http 5.7.17|don't install laravel/framework v5.5.45
    - don't install illuminate/http 5.7.18|don't install laravel/framework v5.5.45
    - don't install illuminate/http 5.7.19|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.0|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.1|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.10|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.11|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.15|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.2|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.20|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.21|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.22|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.23|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.26|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.27|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.28|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.3|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.4|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.5|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.6|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.7|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.8|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.7.9|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.0|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.11|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.12|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.14|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.15|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.17|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.2|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.3|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.4|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.8|don't install laravel/framework v5.5.45
    - don't install illuminate/http v5.8.9|don't install laravel/framework v5.5.45
    - Installation request for laravel/framework (locked at v5.5.45, required as 5.5.*) -> satisfiable by laravel/framework[v5.5.45].
    - Installation request for laravel/socialite ^4.1 -> satisfiable by laravel/socialite[4.1.1, v4.1.0, v4.1.2, v4.1.3].


Installation failed, reverting ./composer.json to its original content.

Steps To Reproduce:

install socialite on laravel v5.5

Discord authentication

As a web developer for a gaming community, I would like to use Discord authentication.
Required:
Login using Discord.
Optional:
Check guilds (and roles/permissions in it).

Google+ APIs being shutdown can we add patch to version 3.*

I got below mail from google, about google plus shutdown.

I am using socialite version 3, is it possible to add the fix in that version please.

thank you.

Dear Developer,

Earlier this week we sent you an email related to your projects that will be impacted by the Google+ API shutdown, which also affects requests for Google+ OAuth scopes.

The email listed that one or more of your projects are requesting the “plus.me” scope, and would thus be affected. We would like to clarify that only projects directly requesting the “plus.me” scope are affected. This scope may have been listed in some emails, even if not directly requested by your project. We apologize for any confusion caused.

If you are directly requesting the “plus.me” scope, any other Google+ OAuth scopes, or making any Google+ API calls, please ensure that you remove these requests from your project before March 7, 2019.

To see if your project is directly requesting the “plus.me” or any other Google+ OAuth scopes:

If your project is written in Google Apps Script, you can view which scopes your project is requesting by reviewing your project properties in App Script Editor.
If your project is not written in Google Apps Script, please check your code for references to “plus.me” in OAuth scope requests. We recommend that you review projects using any 3rd-party libraries that support sign-in or social functionality, as these may also be affected by the shutdown.
Thanks for being a valued Google+ Developer.

Sincerely,
The Google+ API team

Auth code via FB Mobile SDK resulting Invalid Verification Code

I wonder if i can still use Socialite to authenticate FB code that came from Mobile SDK?
Web SDK works fine just code from Mobile SDK throwing Invalid Verification code.

We are trying to implement Login as FB in Flutter but after via facebook login it will generate code like this

EAANXyXf1v7cBAEgxk9Ox1lsfpoSBxZAgBNfl1GWVbyEZBCJQawOBMCmS4Vz5......

and trying to authenticate via Socialite will throw

{
"status": "error",
"exception": "GuzzleHttp\Exception\ClientException",
"code": "SystemError",
"msg": "Client error: POST https://graph.facebook.com/v2.10/oauth/access_token resulted in a 400 Bad Request response:\n{"error":{"message":"Invalid verification code format.","type":"OAuthException","code":100,"fbtrace_id":"H9CluATh6Az"}}\n",
"file": "/home/forge/api.thaimatch.com/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php",
"line": 113
}

I check WEB format FB code and its different from MOBILE SDK code.

Question is can i still use socialite to reauthenticate fb code from SDK?

Socialite v3.3 not using Linkedin V3 api url

  • Socialite Version: 3.3
  • Laravel Version: 5.6
  • PHP Version: 7.1
  • Database Driver & Version:

Description:

Version 3.3 doesn't support the most recent Linkedin api web service. It still uses the v1 which throws the "Not enough permissions error"

Steps To Reproduce:

Checkout V3.3 and below..

Cannot login with state, if I use multi guard

If I logged in one of my guards (for example, guard:admin), I cannot login with another guard (for example guard:web) with socialite with state (without state works fine), because session always regenerated for every refresh.

Is it bug or feature? :)

Failed login with google

I got this issue ones i upload to the server:

Client error: POST https://accounts.google.com/o/oauth2/token resulted in a 400 Bad Request response: { "error": "invalid_request", "error_description": "Missing required parameter: code" }

any solution, thx in advance.

Dynamic configuration is giving error for Google.

I am trying to set dynamic configuration for Google Login. Please check below code. I am using Php framework.

$config = [
'client_id' => 'xxxxxxxxxxxxxxxxxxx',
'client_secret' => 'xxxxxxxxxxxxxxxxxx',
'redirect' => 'http://www.test.com/google/callback/',
];

return Socialite::buildProvider(\Laravel\Socialite\Two\GoogleProvider::class, $config);

When running this code it's showing "The Response content must be a string or object implementing __toString(), "object" given.".

Please help me out

confirm twice redirect outside handleCallback

Hello,

I came accross an issue which i found quite strange. i have this callback function:

public function handleProviderCallback(Request $request, $provider)
{
try {
$socialUser = Socialite::with($provider)->user();
if ($socialUser) {
$this->socialLogin($request, $socialUser, $provider, $socialUser->token);
}
} catch (InvalidStateException $exception) {
return redirect()->back()->with('error', __('auth::auth.noProviderAuthentication'));
}
return redirect()->back()->with('error', __('auth::auth.noSocialLoginPossible'));
}

The socialLogin function contains some other code but at the end of the function calls
return redirect($this->redirectTo);

Now with microsoft as provider i get the Microsoft Oauth2 confirmation screen, click approve but then i need to click approve again. I also see in networking that a route 'reprocess?ctx=...' is called.

When i move the redirect inside the 'handleProviderCallback' all work as expected and i have to click only once in the Microsoft Oauth2 screen.

Is this expected behaviour?

Breaking changes has released as bug fix version in 2.0.21 & 2.0.22

  • Socialite Version: 2.0.21
  • Socialite Version: 2.0.22

Description:

There is breaking change in GoogleProvider between laravel/socialite:2.0.21 and laravel/socialite:2.0.22 but it released as minor fix

Steps To Reproduce:

v2.0.21...laravel:v2.0.22

https://github.com/laravel/socialite/releases/tag/v2.0.22

/**
     * {@inheritdoc}
     */
    protected function mapUserToObject(array $user)
    {
        $avatarUrl = Arr::get($user, 'picture');

        return (new User)->setRaw($user)->map([
            'id' => Arr::get($user, 'id'),
            'nickname' => Arr::get($user, 'nickname'),
            'name' => Arr::get($user, 'name'),
            'email' => Arr::get($user, 'email'),
            'avatar' => $avatarUrl,
            'avatar_original' => preg_replace('/\?sz=([0-9]+)/', '', $avatarUrl),
        ]);
    }

https://github.com/laravel/socialite/releases/tag/v2.0.21

 /**
     * {@inheritdoc}
     */
    protected function mapUserToObject(array $user)
    {
        return (new User)->setRaw($user)->map([
            'id' => $user['id'], 
            'nickname' => Arr::get($user, 'nickname'), 
            'name' => $user['displayName'],
            'email' => $user['emails'][0]['value'], 
            'avatar' => Arr::get($user, 'image')['url'],
            'avatar_original' => preg_replace('/\?sz=([0-9]+)/', '', Arr::get($user, 'image')['url']),
        ]);
    }

Which is causing other open source product:

dreamfactorysoftware/df-oauth#5 (comment)

Thanks,
Sreehari Inukollu

LinkedIn integration does not support scopes

  • Socialite Version: 4.1
  • Laravel Version: 5.8
  • PHP Version: 7.1

Description:

When using linkedIn with scopes, the scope is requested, however the data is not getting fetched afterwards.
When I for example have the scope r_basicprofile, I should be able to get the vanityName, however this data is not getting fetched.

Looking into the provider, we have a bunch of hardcoded properties, these do not change depending on which scope I am requesting.

Steps To Reproduce:

Make a request with scope r_basicprofile.

Undefined Index: Image for Google Login Provider

Hi, I have recently updated Laravel Socialite from v^3 to v^4.0.3 and disabled the Google+ API. So, now when I try to register using Google then, I am getting this error which says 'Undefined Index: Image'. Can you go ahead and check if everything is fine?
screenshot 2019-01-30 at 10 31 24 am

Integrate with Reactjs

How can I make a rest api with the redirectToProvider function because when I call it in my React app, it says cross origin error. Thanks!

Sending login token back to frontend after login

My auth is done using a Passport. I have successfully logged in and return the callback with the user. However, when the frontend hits the endpoint that sends them off to Google Login, there is no way to return a token from the first endpoint since the user already left the site. How can I send back a token to frontend? Or should I use something else to login users via social accounts on the frontend side (ex: https://www.npmjs.com/package/satellizer)?

Issue with Google+ Provider

Error when authenticate with google+ provider (Socialite version 4.0.0).
I tried downgrade socialite version to 3.1.1 and it is working.

image

GoogleProvider.php
image

Anyway, is there any way to override mapping function from response we get from provider to user object? it would be nice if got one.

Bad Request - Invalid Scope - Scope Parameter Error - AADSTS70011

Client error: POST https://login.microsoftonline.com/common/oauth2/v2.0/token resulted in a 400 Bad Request response: {"error":"invalid_scope","error_description":"AADSTS70011: The provided request must include a 'scope' input parameter.\ (truncated...)

We have created an App under MS app section & using it for Calendar synchronization. While we are trying to authenticate the MS account from our website, it returns back to the website & throwing the above error.

Code: Socialite::driver($provider)->stateless()->user();

Specifically, when we used the above statement, we are getting the error. We tried changing all the App permission, tried with new App ID/Key etc., But again getting the same error. Not sure what we are missing. By the way, the library codes which we are using is 3 months old (Version 3.3). Not sure it's because of this as it was working perfectly fine 3 months ago.

Your timely help would enable us to go live with this feature soon.

Reconsider a new V3 release – Google Sign-in

Please reconsider the choice of making a stable tag for Laravel LTS 5.5 users.


@driesvints
I know we can use it like that but what i requested it to tag a release as it is stable and official working as per Google SignIn. as because all the LTS 5.5 users are affected I wanted you to tag that as soon as possible

Originally posted by @msonowal in #335 (comment)

[v3] Google+ APIs being shutdown

Hi,

I'm still using laravel 5.4 for php version reason. But, I got an email which saying that Google+ APIs being shutdown. But, unfortunately the changes are made for v4. Could you help me how I can use the changes which made in #283 for v3 ?

Thanks

Facebook - loging via telephone number

Hi,
Im using socialite for some time and i faced problem with loging via facebook.
Some users got new Facebook acounts registered via telephone number not email, so they are loging via phone number and e-mail field is empty. On my application socialite module is throwing errors that it cant find email adress or email is empty.
Is there any override or solution for this problem?

I can't modify fields in Linkedin

This is the Code I am using

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Socialite;
use App\Models\User;

class LoginController extends Controller {

use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct() {
        $this->middleware('guest')->except('logout');
    }

    /**
     * Redirect the user to the GitHub authentication page.
     *
     * @return \Illuminate\Http\Response
     */
    public function redirectToLinkedin() {
        $fields = [
            "id", "firstName", "lastName",
            "maidenName", "headline", "specialties",
            "positions", "pictureUrl", "emailAddress"
        ];

        return Socialite::with('linkedin')
                        ->fields($fields)
                        ->redirect();
    }

    /**
     * Obtain the user information from GitHub.
     *
     * @return \Illuminate\Http\Response
     */
    public function handleLinkedinCallback(Request $request) {
        $linkedinUser = Socialite::driver('linkedin')->user();

        // check if user exists in DB
        $user = User::where('linkedin', '=', $linkedinUser['id'])->first();

        // if user doesn't exit go to sign up page and populate form
        if (!$user) {

            $request->session()->put('linkedinUser', $linkedinUser->user);

            return redirect()->route('signup');
        }
//                if user exists login him/her
        Auth::loginUsingId($user->id);

        return redirect('/');
    }
}

but positions never return, I debugged the file

vendor/laravel/socialite/src/Two/LinkedInProvider.php
and var_dump
$fields
and it didn't change the default fields

Enhancement: interface with Instagram

Hi all,
would it be possible to expand the library to be able to interface with Instagram so that social login using it will be possible?

I would like to contribute more but my coding skills are way too limited.

The Response content must be a string or object implementing

I'm trying to get user details using google , facebook and Twitter. but im unable to success from last two days. after login gmail auth, url redirected to callback url and getting below error.

The Response content must be a string or object implementing __toString(), "object" given.

//Controller code
public function redirectToProvider()
{
return Socialite::driver('google')->redirect();
}

 public function googleCallback()
{      
        try {
         return $user = Socialite::driver('google')->userFromToken('google');
        }
        catch (GuzzleHttp\Exception\ClientException $e) {
           dd($e->response);
        }

}

//env
GOOGLE_CLIENT_ID=--------------------.googleusercontent.com
GOOGLE_CLIENT_SECRET=------
GOOGLE_URL=http://example/subscribe/google/callback

//services.php
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => env('GOOGLE_URL'),
],
//routes
Route::get('subscribe/google', 'Auth\LoginController@redirectToProvider');
Route::get('subscribe/google/callback', 'Auth\LoginController@googleCallback');

I have enabled google+ API also
Please help me

Thanking you in advance

Facebook OAuth exception - the app is configured as a desktop app

Client error: `POST https://graph.facebook.com/v3.0/oauth/access_token` resulted in a `400 Bad Request` response: {"error":{"message":"The request is invalid because the app is configured as a desktop app","type":"OAuthException","cod (truncated...)

i am getting this error when i am trying to login using facebook any ideas about this ? please do give any suggestions to get this work out.......

Logging in with bitbucket isn't working as expected

So I am running against a problem which I didn't expect when I follow the documentation.

I have the following version of socialite installed (composer.lock):

"name": "laravel/socialite",
"version": "v4.0.3",

And I am running the following code:

try {
    /** @var AbstractUser $socialiteUser */
    $socialiteUser = Socialite::driver($provider)->user();
} catch (Throwable $exception) {
    return redirect()->back()->withMessage(
        $exception->getResponse()->getBody()->getContents()
    );
}

This will always get an exception back.
So I tracked this down to the point where socialite is always asking for a "code" that should be in the request but is always null.

I hope anyone has an idea on why this is going wrong.

Linkedin Oauth fails of user is missing a profile picture

Using
"laravel/socialite": "^4.0"

I get a "array_filter() expects parameter 1 to be array, null given" when it tries to run mapUserToObject() in socialite/src/Two/LinkedInProvider.php.

My test account is missing an avatar image.
var_dump of the $user object passed to it.

array (size=4)
  'firstName' => 
    array (size=2)
      'localized' => 
        array (size=1)
          'en_US' => string 'Mark' (length=4)
      'preferredLocale' => 
        array (size=2)
          'country' => string 'US' (length=2)
          'language' => string 'en' (length=2)
  'lastName' => 
    array (size=2)
      'localized' => 
        array (size=1)
          'en_US' => string 'Smith' (length=8)
      'preferredLocale' => 
        array (size=2)
          'country' => string 'US' (length=2)
          'language' => string 'en' (length=2)
  'id' => string 'BhcxETf1d3' (length=10)
  'emailAddress' => string '[email protected]' (length=24)

Facebook is removing access to "certain permissions or features on Mar 28, 2019"

We are getting notifications from Facebook that say:

Access to the permissions and features listed below will expire on Mar 28, 2019.
user_gender
user_friends
user_age_range
user_link

If you still require access to these permissions and features, please submit for App Review to avoid losing access.

Socialite's FacebookProvider is, by default, requesting the following fields:

['name', 'email', 'gender', 'verified', 'link'];

Since gender and link appear in that list, I think that Socialite calls through apps that don't have the special permissions will start to fail on March 28th?

I'll confess I'm not sure, but thought I would raise the issue so there would be some time to deal with it before the 28th if it's an issue.

Facebook expiration is not set

  • Socialite Version: 3.2.0
  • Laravel Version: 5.7.28
  • PHP Version: 7.1.23
  • Database Driver & Version: Postgres 10.6

Description:

It seems Facebook’s changed how it returns access tokens since Socialite was last updated and the expiration date is no longer surfaced (and therefore set by Socialite). It’s also unclear whether the token Socialite returns is a “short-lived” token or a “long-lived” token.

It is possible to “debug” a Facebook access token: (https://developers.facebook.com/docs/graph-api/reference/v3.2/debug_token). But again, this is confusing as that endpoint returns two “expires” timestamps: an expires_at timestamp and a data_access_expires_at timestamp.

I’m not sure whether it would be acceptable for Socialite to make a second HTTP call just to fetch the expires_at timestamp value, but it sure would be helpful in my application(s) so that for stored access tokens, I can see when they expired and if they need refreshing.

Steps To Reproduce:

  1. Create a route to authenticate with Facebook.
  2. Create a route to handle the callback from Facebook.
  3. Observe that expiresIn is null when calling Socialite::driver('facebook')->user().

Updating 2.0 To Support V2 LinkedIn Endpoints

LinkedIn deprecated their V1 login endpoints at the start of this month. Only the new V2 endpoints can be used going forward. I noticed that while the 4.0 branch has been updated to reflect the new V2 endpoints, branches 2.0 and 3.0 are still pointing to the old V1 endpoints.

Is there a way we can make minor updates to version 2.0 so that it points to the V2 URLs? I am currently working on a project with Laravel 5.0 and PHP 5.6 so cannot upgrade to 4.0.

From what I can tell, the $url variable inside of the getUserByToken() method in LinkedInProvider.php needs to be updated from:

$url = 'https://api.linkedin.com/v1/people/~:('.$fields.')';

to

$url = 'https://api.linkedin.com/v2/me/?projection=('.$fields.')';

protected $scopes = ['r_basicprofile', 'r_emailaddress'];

also needs to be changed to

protected $scopes = ['r_liteProfile', 'r_emailaddress'];

at the top of the file. By default, LinkedIn will only grant access to a "lite" profile now unless you explicitly request expanded access by submitting a support ticket with them.

Not sure if there are any other items that need to be changed. If so, please chime in. I am happy to add a pull request for this if need be.

No support for Laravel 5.5 and 5.6

For some reason, socialite has no version that works with Laravel 5.5 or 5.6. Especially 5.5 is really bad, as it is a long term release.

Socialite 3.*:

"require": {
        "php": ">=5.6.4",
        "guzzlehttp/guzzle": "~6.0",
        "illuminate/contracts": "~5.4",
        "illuminate/http": "~5.4",
        "illuminate/support": "~5.4",
        "league/oauth1-client": "~1.0"
    },

Socialite 4.*:

"require": {
        "php": "^7.1.3",
        "ext-json": "*",
        "guzzlehttp/guzzle": "~6.0",
        "illuminate/contracts": "~5.7.0|~5.8.0",
        "illuminate/http": "~5.7.0|~5.8.0",
        "illuminate/support": "~5.7.0|~5.8.0",
        "league/oauth1-client": "~1.0"
    },

Is this on purpose?

Regarding facebook login issue

  • Socialite Version: 3.1
  • Laravel Version: 5.5
  • PHP Version: 7.0
  • Database Driver & Version: PDO

Description:

Hello,

I am using socialite 3.1 version using laravel 5.5 where I am successfully logged-in with Facebook into my system but after then it's taking too much time to get back to the system like 25 to 30 second.

What can be fixed for the same? Please let me know.

Thanks,

Steps To Reproduce:

No Message error using g+ login

When i try logging in using G+ it works perfectly on localhost:: but doesnt work on live testing, it gives the error "no message" at "/vendor/laravel/socialite/src/Two/AbstractProvider.php".
Screenshot 2019-04-29 at 4 13 33 PM

 'google' => [
             'client_id' => '**********.apps.googleusercontent.com',
             'client_secret' => '*****',
            'redirect' => 'http://uat1gdg.***.com/login/google/callback',
        ],

Retrieve original avatar for Google

403 error in google auth

i m using laravel 5.6 and socialite 3.0, all other APi are working except google showing HTTP Error 403 - Forbidden. I have tried everywhere on google, stackoverflow but no answar. What is the issue

Issue with oAuth 2.0 LinkedIn Upgrade API Web Service

I got this error when I try to login with my LinkedIn Account
laravel/socialite": "^3.1"

and here is script
$userSocial = Socialite::driver('linkedin')->user();

here is the developer update from linkedin
(https://engineering.linkedin.com/blog/2018/12/developer-program-updates)

Client error: GET https://api.linkedin.com/v1/people/~:(id,first-name,last-name,formatted-name,email-address,headline,location,industry,public-profile-url,picture-url,picture-urls::(original)) resulted in a 410 Gone response: { "errorCode": 0, "message": "This resource is no longer available under v1 APIs", "requestId": "3WIBWBXOPW", "s (truncated...)

How to fix this issue ?

Thank you

Magento

Is it possible to create a way to use Magento with Laravel Socialite?

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.