Giter Club home page Giter Club logo

providers's Introduction

A Collection of Providers for Laravel Socialite

Documentation

Full documentation for using these providers can be found at the Documentation.

Contribute

Submit Pull Requests here for new providers. See the docs for more information.

providers's People

Contributors

27pchrisl avatar amaelftah avatar antonkomarev avatar atymic avatar autaut03 avatar brianwozeniak avatar claudsonm avatar clink-aaron avatar dees040 avatar dingdayu avatar faustbrian avatar jamessiebert avatar jimbolino avatar jstowey avatar lucasmichot avatar lukecurtis93 avatar m1guelpf avatar max13 avatar mzur avatar nickbeen avatar real-throttlehead avatar recca0120 avatar robiiinos avatar ryanvade avatar saundefined avatar sinkcup avatar sofwar avatar spekulatius avatar superdj avatar tobz-nz 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

providers's Issues

Merge of Microsoft-Graph and Microsoft-Live into new Microsoft provider

Both providers use the same urls for requesting tokens and api calls:

https://github.com/SocialiteProviders/Providers/blob/master/src/Microsoft-Graph/Provider.php#L33
https://github.com/SocialiteProviders/Providers/blob/master/src/Microsoft-Live/Provider.php#L32

The Microsoft-Azure provider uses the deprecated V1.0 api, but i do like the configurable "tenant"
https://github.com/SocialiteProviders/Providers/blob/master/src/Microsoft-Azure/Provider.php#L36

Would it be ok if I:

  • Create a new provider "microsoft"
  • Mark these 3 as deprecated

Laravel 5.2 - Socialite Providers Twitter give me bad authentication data

I use Laravel 5.4 with Socialite Providers (http://socialiteproviders.github.io/providers/twitter/)

I want build an application with two Twitter services with no the same credentials.

I use this in services.php:

'twitter' => [
    'client_id' => env('TWITTER_KEY'),
    'client_secret' => env('TWITTER_SECRET'),
    'redirect' => env('TWITTER_REDIRECT_URI'),
],

I have this to my controller:

$config = new SocialiteProvidersConfig(
    env('TWITTER_CONSUMER_KEY_2'),
    env('TWITTER_CONSUMER_SECRET_2'),
    env('TWITTER_REDIRECT_URI_2')
);

return Socialite::with('twitter')->setConfig($config)->redirect();

I have my credentials to .env:

TWITTER_KEY=
TWITTER_SECRET=
TWITTER_REDIRECT_URI=

TWITTER_CONSUMER_KEY_2=xxx
TWITTER_CONSUMER_SECRET_2=xxx
TWITTER_REDIRECT_URI_2=http://localhost/twitter/login/callback

TWITTER_CONSUMER_KEY_3=xxx
TWITTER_CONSUMER_SECRET_3=xxx
TWITTER_REDIRECT_URI_3=http://localhost/twitter/login/callback

But, I have this error when I try to connect my Twitter account:

Received HTTP status code [400] with message
"{"errors":[{"code":215,"message":"Bad Authentication data."}]}" when
getting temporary credentials.

I have the impression that the configuration is not taken into account.

enter image description here

Problems with vk provider.

According to https://vk.com/dev/version_update, you should include version as get param in your requests. For example:

$response = $this->getHttpClient()->get( 'https://api.vk.com/method/users.get?v=5&user_ids='.$token['user_id'].'&fields='.implode(',', $this->fields).$lang.'&https=1' );

Flickr Issue

Hello,

I'm not sure that I have to post the issue here but the flickr socialite provider keeps asking to grant permissions each time I call to login. I've manage to save the responded user and save it to the session. Is that the way flickr works?

nest provider?

Hi, Have you ever considered a provider for the NEST API? :)

discord accept invite

is there a way to make a user accept a discord invite through the discord provider?

Add normalized profileUrl to all providers

Would it be possible to add a normalized profileUrl to all providers. Facebook returns this in the provider->user object but providers like twitter do not. It would be beneficial to have this for other providers as well: twitter, google (when plus is enabled), twitch and others.

This attribute is very helpful in helping users know which social account is being used with that provider. Sometimes they have more than one account with the provider or are not sure which account is linked.

If this seems like an acceptable change I would be happy to make the appropriate PR to accomplish this.

Steam provider needs a release

It's been months and I've been using it on my old project. But now for 5.4 it's in dire need of an update and a proper release so we don't have to change minimum-stability

How can i Avoid Laravel Socialite to Authenticate a User if i just wanna return the user details and process it ?

I know this is kind weid but i have an application that utilized laravel sociate and extenstion...
i never used the built in twitter and facebook, so i can change config based on user...

but the normal behaviour would be, is if im already authenticated by laravel passport...
then i tried to authenticated via facebook or twitter,
my old token is being invalidated,

i wanna know what method that really makes this happens,
my hunch is mapUserToObject but i belive this is just mapping the credentials fetched from any service provider...

maybe the setToken ,method in Class
vendor\laravel\socialite\src\Two\User.php
vendor\laravel\socialite\src\One\User.php

I wouldnt like to messed up built in functionality
But i would like to remove or avoid calling setToken

Can someone help me with this?
I just wanna return the userdetails and tokens after they authenticated in facebook or twitter...
but i dont want to authenticate them anymore in my app since they are authenticated already

hope someone can drop a good pointers for this thanks

Slack oauth url redirecting to a url that is not for the app.

Expected Behavior:
Click Login/Signup
Redirect you url https://(slackteam).slack.com/oauth/
Click 'Continue'
At Dashboard.

Current Behavior:
Click Login/Signup
Redirect you url https://(slackteam4).slack.com/oauth/
ERROR: OAuth Error: invalid_team_for_non_distributed_app

How to Reproduce:

  1. Login to slackteam1 https://(slackteam).slack.com/
  2. Login to slackteam4 https://(slackteam4).slack.com/
  3. Go to your Login page on laravel. Click slack Login

I assume need a way to direct people to the correct slackteam oauth url. Might need another configuration.

Call to undefined method Illuminate\Session\Store::set() with Linkedin login

I have used Laravel Socialite with default configuration another social like google,Facebook,Twitter is work fine but when I create Linkedin it respond as below errors

"require": {
"php": ">=5.6.4",
"laracasts/flash": "^2.0",
"laravel/framework": "5.4.*",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
"nesbot/carbon": "^1.22",
"socialiteproviders/google": "^3.0",
"socialiteproviders/linkedin": "^3.0",
"socialiteproviders/twitter": "^3.0",
"twbs/bootstrap": "4.0.0-alpha.6"
},

vendor/socialiteproviders/linkedin/Provider.php line 76:
Call to undefined method Illuminate\Session\Store::set()

Thank for help

Socialite::driver('buffer')->user() throws ClientException 400 Bad Request` response: {"error":"invalid_grant"}

The grant_type parameter seems to be correct according to the API docs: https://buffer.com/developers/api/oauth

Here's a partial dump of the stack trace from the point where my code hands over to the Buffer provider.

in RequestException.php line 111
at RequestException::create(object(Request), object(Response)) in Middleware.php line 65
at Middleware::GuzzleHttp\{closure}(object(Response)) in Promise.php line 203
at Promise::callHandler('1', object(Response), array(object(Promise), object(Closure), null)) in Promise.php line 156
at Promise::GuzzleHttp\Promise\{closure}() in TaskQueue.php line 47
at TaskQueue->run(true) in Promise.php line 246
at Promise->invokeWaitFn() in Promise.php line 223
at Promise->waitIfPending() in Promise.php line 267
at Promise->invokeWaitList() in Promise.php line 225
at Promise->waitIfPending() in Promise.php line 62
at Promise->wait() in Client.php line 129
at Client->request('post', 'https://api.bufferapp.com/1/oauth2/token.json', array('headers' => array('Accept' => 'application/json'), 'form_params' => array('client_id' => <snip>, 'client_secret' => <snip>, 'code' => <snip>, 'redirect_uri' => 'http://<snip>/buffer/callback', 'grant_type' => 'authorization_code'), 'synchronous' => true)) in Client.php line 87
at Client->__call('post', array('https://api.bufferapp.com/1/oauth2/token.json', array('headers' => array('Accept' => 'application/json'), 'form_params' => array('client_id' => <snip>, 'client_secret' => <snip>, 'code' => <snip>, 'redirect_uri' => 'http://<snip>/auth/buffer/callback', 'grant_type' => 'authorization_code')))) in AbstractProvider.php line 255
at AbstractProvider->getAccessTokenResponse(<snip>) in AbstractProvider.php line 35
at AbstractProvider->user() in SocialAuthController.php line 111

No facebook provider

I know I could use Facebook provider for the default socialite provided by laravel, but laravel socialite doesn't provide a way for me to modify the redirect url (for dynamic url).

Hence, the i decided to use this package, but I discovered that there is no Facebook provider available.

Microsoft Azure: The request body must contain the following parameter: client_id

I'm using the microsoft-azure provider and I get the following error message on the callback.

"error":"invalid_request","error_description":"AADSTS90014: The request body must contain the following parameter: 'client_id'

This is the code I'm using.

$config = new \SocialiteProviders\Manager\Config($config->client_id, $config->client_secret, $config->redirect_url, [
    'tenant' => $config->tenant_id
]);

return Socialite::with('azure')->setConfig($config)->redirect();

And then on the callback I run;

try {
    $user = Socialite::driver('azure')->user();
} catch (Exception $e) {
    dd($e->getResponse()->getBody()->getContents());
}

And it falls in the catch and returns the message above.

Any thoughts?

JIRA: Handling case where user denies authentication.

When handling the OAuth callback from JIRA:

$user = Socialite::driver('jira')->setConfig($config)->user()

if the user denies the OAuth request, the Socialite provider throws a Client Exception with this message:

Client error: 'POST https://JIRA_BASE_URI/plugins/servlet/oauth/access-token?oauth_verifier=denied' resulted in a '401 Unauthorized response: oauth_problem=permission_denied'

(Note: my base URI is configured, I've just swapped it for 'JIRA_BASE_URI' for privacy).

What I understand from this is that the provider is assuming that the user has authorised the consumer and is attempting to retrieve the access token from JIRA.

As I can't seem to find any official documentation on this matter, what would be the best way to handle it?

Twitter: blocks php artisan from running

The twitter provider blocks artisan from running If you do not specify a value for client_id and client_secret in config/services.php. The setup could be like this where you defer the values to the .env file:

    'twitter' => [
        'client_id' => env('TWITTER_KEY'),
        'client_secret' => env('TWITTER_SECRET'),
        'redirect' => env('TWITTER_REDIRECT_URI')
    ],

Typically when you deploy your app through some CI you might not have the .env file when running composer install and thus php artisan optimize.

Other providers like Facebook and Instagram has no issues with this.

Sample error:

$ php artisan --help

  [InvalidArgumentException]
  Missing client credentials key [secret] from options.

ps: A temporary solution, if you have this problem, is to just provide a dummy default value until an .env can be placed.

Help with JIRA provider

Hey there, if this is the wrong place for this kind of post please direct me to the proper one.

I'm attempting to use the JIRA Socialite provider and cannot get it to work.

I have generated the jira.pem and jira.pub keys and they seem to be loaded fine, I've also added the application link to my JIRA instance and ensured the jira.pub key is pasted in the "Incoming Authentication" section. Still nothing works: attempting Socialite::with('jira')->redirect(); returns:

Received HTTP status code [401] with message "oauth_problem=consumer_key_unknown" when getting temporary credentials.

How do I properly use this provider? JIRA seems different from most of the other providers in the way the generic app is granted access, and that difference is not documented in the stub documentation of this particular provider.

My config/services.php block:

'jira' => [
        'client_id' => env('JIRA_KEY'),
        'client_secret' => env('JIRA_SECRET'),
        'redirect' => env('JIRA_REDIRECT_URI'),
        'base_uri' => env('JIRA_BASE_URI'),
    ],

My .env settings:

JIRA_KEY="test123"
JIRA_SECRET='test123'
JIRA_REDIRECT_URI=http://laravel.dev/login
JIRA_BASE_URI=http://atlassian.dev:8090

Does anyone use this provider that can give some guidance?

Laravel 5.5 question

I see in the docs that you, you may need to remove
Laravel\Socialite\SocialiteServiceProvider

but by default in laravel 5.5

the socialiteserviceprodiver is being loaded...

how can i disabled it then?

Is SocialiteProviders/Xing broken?

Hello,

can anyone confirm that SocialiteProviders/Xing is working?

Looks like XING disabled their API for new users. I am only able to create a "Login with XING Plugin" which provides me a consumer key & signature salt

Discord - Additional scope support natively

Hi, do you have plans to natively implement adding the other available scopes in gateway v6 (guild list, connections specifically)? These are extremely helpful tidbits to have when creating a web UI for a bot.

How can we use the refresh token?

Hi,

I have learned how to get a token after the login via OAuth 2 providers (like Envato), but the token expires after 1 hour.

Any way how to handle this case?

Thanks

PHP requirement

All of the providers seem to have a PHP requirement of 5.6 || 7.0 registered in composer.json. This commit allowed use of the 2.0 socialiteproviders/manager branch which has PHP requirement of >=5.4.0.

Any reason for this? Happy to submit a PR that either removes the PHP requirement from each provider or change it to >=5.4.0

Microsoft Live / Azure issue

When using the current version of Microsoft Live provider, I was facing this problem:

Client error: 'POST https://login.live.com/oauth20_token.srf' resulted in a 400 Bad Request response: {"error":"invalid_request","error_description":"The provided request must include a 'code' input parameter."} in RequestException.php line 111

So I went out to figure out what was causing this issue. I checked the redirects URIs on the Microsoft Application Registration Portal and they were the same. As the returned url was pointing out [http://localhost:8000/auth/live/callback?error=unauthorized_client&error_description=The client does not have a secret configured. If you are the client application developer, configure a secret through the application management site at https://apps.dev.microsoft.com/.&state=8gIw(...)], I was using the PRIVATE KEY instead of the PASSWORD [PASSWORD should be the correct one] as the LIVE_SECRET on .env, but fixing it didn't solve the issue either.

Digging deeper, found someone facing similar issue, tried to learn more about the API flow to understand it's functions I found that they were replaced by a newer one.

They converged the multiple authorization (authentication consequently) as one service using the Microsoft Graph and the Azure AD v2.0 endpoint. So, from there, I was able to dig into the messy Microsoft documentation and find the solution. Using the v2.0 endpoints for Azure AD listed here and here and being guided by this tutorial.

Just as documentation:
Authorize access to web applications using OAuth 2.0 and Azure Active Directory
OAuth 2.0 Authorization Code Flow
Scopes, permissions, and consent in the Azure Active Directory v2.0 endpoint
Microsoft Graph permission scopes
User Entity - Declared properties for authenticated user entity.

Just to be clear: these new endpoints understand the nature of the Microsoft account used for the authorization (if work/student then redirects to a specific page, if "normal" outlook/live/hotmail account, redirects to another, I tested both of them). This may cause some confusion, as this is not just "Microsoft Live" auth only (or is it? Is Outlook 365 a part of "Microsoft Live"? I don't even know anymore heheh).

I didn't change Microsoft Azure, as this seems as an structural-decision I am not fully capable of making.

Shopify provider redirecting to shopify without subdomain

I can't figure out how thte shopify provider is getting the subdomain out of the incoming request _GET params.
It doesn't seem to be doing it at all - and the resulting invalid url it redirects to backs that up.
eg: https://.myshopify.com/admin/oauth/authorize....

Am I missing something?

LinkedIn Provider

Hello everyone!

I have been struggling to retrieve some more fields from the r_basicprofile scope (summary, specialties, positions).

In this provider, there is no configuration for the fields to request and changing them in the code made no difference.
https://github.com/SocialiteProviders/Providers/blob/master/src/LinkedIn/Provider.php line 96

        $response = $this->getHttpClient()->get(
            'https://api.linkedin.com/v1/people/~:(id,first-name,last-name,formatted-name,summary,specialties,email-address,headline,location,industry,positions,public-profile-url,picture-url,picture-urls::(original)', [
            'headers' => [
                'Accept-Language' => 'en-US',
                'x-li-format' => 'json',
                'Authorization' => 'Bearer '.$token,
            ],
        ]);

To get those fields, I had to mess with Socialite's official LinkedIn Provider
https://github.com/laravel/socialite/blob/3.0/src/Two/LinkedInProvider.php line 28

    protected $fields = [
        'id', 'first-name', 'last-name', 'formatted-name', 'summary', 'specialties',
        'email-address', 'headline', 'location', 'industry', 'positions',
        'public-profile-url', 'picture-url', 'picture-urls::(original)',
    ];

Is there any way to configure the fields to be requested?

Thank you in advance!

Twitter Stateless Session store not set on request.

I'm trying to implement stateless redirecting to twitter from my Lumen app, but every time it gives an error saying: Session store not set on request.

I followed all the installation instructions of the Twitter provider correctly.

Although the provider should automatically detect I want stateless, I extra noted it in the call:
return Socialite::driver('twitter')->stateless()->redirect();

Do you guys have an idea what might be wrong?

Google Plus Auth for a single tld

Am not sure if I am creating the issue at the right place. I started implement Google Authentication using the Google-Plus provider. Is there a way to allow only a single tld? For example if my Google Auth is being built on foo.com, I only want the auth to work with @foo.com and not any other email. Is there a config to do this or is there another way to implement this.

Stripe Provider sending the wrong ID

When using the stripe provider the docs call to add this to my ENV

STRIPE_KEY=yourkeyfortheservice
STRIPE_SECRET=yoursecretfortheservice
STRIPE_REDIRECT_URI=https://example.com/login  

The actual URL of the stripe oauth calls for the client_id and not the stripe key, which is whats being put into the URL. The client_id is created when you create an app in Stripe connect. That ID is what needs to be sent in the client_id parameter.

https://connect.stripe.com/oauth/authorize?client_id=pk_test_XXXXXXXXXX&redirect_uri

Composer Doesn't Find Shopify Provider

The Shopify provider doesn't seem to be completely installed/released.

I had to go all the way to adding the Shopify provider's git url to the repositories array, because without it, Composer kept throwing "The requested package socialiteproviders/shopify could not be found in any version," errors.

In the process of troubleshooting, I also found that the Shopify provider only registers versions 1.0 and dev-master. There is no 2.0 version, like there is with the other providers.

(To compare, I did test installs of the Discord provider, which worked as expected by installing version 2.0 with the composer require command, meaning it's an issue with the Shopify provider and not my access to SocialiteProviders as a whole.)

Laravel 5.4 - Socialite Providers multiple configurations with Twitter

I have two services to connect with Socialite Provider:

use Laravel\Socialite\Facades\Socialite;
use \SocialiteProviders\Manager\Config;

public function connect_1() {
	$config1 = new Config(
	    env('TWITTER_CONSUMER_KEY_1'),
	    env('TWITTER_CONSUMER_SECRET_1'),
	    env('TWITTER_REDIRECT_URI_1'),
	    [
	        //
	    ]
	);

	return Socialite::with('twitter')->setConfig($config1)->redirect();
}

public function connect_2() {
	$config2 = new Config(
	    env('TWITTER_CONSUMER_KEY_2'),
	    env('TWITTER_CONSUMER_SECRET_2'),
	    env('TWITTER_REDIRECT_URI_2'),
	    [
	        //
	    ]
	);

	return Socialite::with('twitter')->setConfig($config2)->redirect();
}

But, I have this error when I try this code:

Configuration for TWITTER_KEY is missing. There is no services entry
for twitter

Mastodon Support

It would be nice to have a Mastodon Socialite provider that also allows the ability to pass in which instance you are attempted to authenticate to, since the instances are distributed.

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.