Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Laravel Socialite and BadRequestException #4

Open
mCIN4R opened this issue Aug 8, 2018 · 4 comments
Open

Compatibility with Laravel Socialite and BadRequestException #4

mCIN4R opened this issue Aug 8, 2018 · 4 comments
Labels
feature This issue is a feature request in progress A resolution for this issue is in progress

Comments

@mCIN4R
Copy link

mCIN4R commented Aug 8, 2018

Hoi Bailey,

I want to handle the authentication process with Laravel Socialite. How can we make this package compatibility with the Laravel Socialite package or is that not possible?

Also;
When I try to verify purchase code I am always getting a "400 Bad Request" message.

I am trying like so: $response = $client->user->sale(['code' => $purchase_code]);

The "code" parameter is not applied in to the url schema. Why?

@baileyherbert
Copy link
Owner

baileyherbert commented Aug 8, 2018

Hi!

I just merged a pull request which fixes the url schema issue. Can you please update the package on Composer and give it another shot?

Let me know how it goes! 👍

@baileyherbert baileyherbert added the bug This is a bug label Aug 8, 2018
@baileyherbert
Copy link
Owner

Ah, and with respect to Socialite compatibility, this is something I'll definitely look into for you shortly, but this would be it's own package. I'll let you know.

@mCIN4R
Copy link
Author

mCIN4R commented Aug 8, 2018

Great. It is working now. 👍

The Laravel Socialite compatibility would be really helpful for Laravel users. I am adding some source links to help you out with that.

  1. Laravel Socialite
  2. Envato Socialite Provider

Can't wait to see the Socialite compatibility. Thank you.

@baileyherbert baileyherbert added feature This issue is a feature request in progress A resolution for this issue is in progress labels Aug 8, 2018
@envatic
Copy link

envatic commented Mar 13, 2019

Intergrattion is easy.
In socailite return function make sure you save the whole user
$socialUserObject = Socialite::driver( 'Envato' )->user();
// you need to update the expires before
$socialUserObject->expiresIn += time()-60;
save $socialUserObject above is database as json or array so you use it anytime.
// when you need to use the APi apply this $socialUserObject like this.

$oauth->load([
		'access_token' => $socialUserObject->token,
		'refresh_token' => $socialUserObject->refreshToken ,
		'expires' => $socialUserObject->expiresIn
	]);

@baileyherbert baileyherbert removed the bug This is a bug label Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue is a feature request in progress A resolution for this issue is in progress
Projects
None yet
Development

No branches or pull requests

2 participants