Bad Request when using Socialite on Facebook - laravel

I am using Socialite Package (https://laravel.com/docs/6.x/socialite) in my project.I have done following:
Register Application on Facebook
Get Client Secret and ID
Installed Socialite Package using composer
configure .env files
configure callback url
But when after successful callback, my app shows following errors on this command
Socialite::drive("facebook")->user()
error: Client error:
POST
https://graph.facebook.com/v3.3/oauth/access_tokenresulted in a400 Bad Request
Response:
{
"error":{
"message": "URL \u0644\u0648\u0688 \u0646\u06c1\u06cc\u06ba
\u06a9\u06cc\u0627 \u062c\u0627 \u0633\u06a9\u062a\ (truncated...)
A:\xampp\htdocs\PLAGX_FRONTEND\px-web\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php

The issue is with the SSL of your callback url, the response seems to be not properly decoded by the receiver party. Turning SSL on your localhost or deployment server could help.

Related

Laravel Passport error when login, use together with Laravel Socialite

I'm building 2 apps which 1 for the OAuth by using Laravel Passport and another app is using the Laravel Socialite with the Provider from https://socialiteproviders.com/Laravel-Passport/
I have set up all the route and have ran passport:install
And at the second application, I have install Laravel Socialite with provider.
Provider settings are also set in config and .env file
But when I try to login, it show error as below, but I confirm that I can login normally using web in OAuth application
Client error: `POST http://localhost:8002/oauth/token` resulted in a `401 Unauthorized` response: {"error":"invalid_client","error_description":"Client authentication failed","message":"Client authentication failed"}
What am I missing? Any help is appreciated.

gocardless webhook 419 Authentication Timeout error

I'm trying to integrate gocardless webhook in my website. I'm developing my site in laravel 5.5. Right now i'm following their instrution. But getting an error 419 Authentication Timeout. I did exactly as followed from their documentation. https://developer.gocardless.com/getting-started/api/staying-up-to-date-with-webhooks/
I created a POST route in my web.php file
Route::post('/test', 'GocardlessWebhookController#remote');
Then i put my secret token in my env file. In the controller i copy paste the same code from that site. Then i trigger the webhook from sandbox test environment.
Can anyone help me out?

laravel socialite 3.0 getting error during Google+ login

laravel
Client error: GET https://www.googleapis.com/plus/v1/people/me?prettyPrint=false resulted in a 403 Forbidden response:
{"error":{"errors":[{"domain":"usageLimits","reason":"accessNotConfigured","message":"Project
892227784590 is not found (truncated...)
Make sure you've created an application in Google's console and also have your client id and client secret from google. Also make sure you've configured google option in your config/services.php.

Getting token in Google Analytics API for Postman

I need to create request for getting data from Google Analytics API in Postman. I managed to generate access token with playground platform but I need permanent refresh token (in playground I can generate only 24h token).
I tried to generate token in Console API:
I've created project
Add analytics API in my project
Generate client ID and secret code
But I don't know which redirect URL using. Default value that was generate in JSON is urn:ietf:wg:oauth:2.0:oob","http://localhost
Than I've generated authorization code with request (from browser):
https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/analytics&redirect_uri=http://localhost&response_type=code&client_id=XXXX
And when I tried to generate access_token with POST request in Postman, sending such keys:
code:XXXXXX
redirect_uri:urn:ietf:wg:oauth:2.0:oob (also tryed http://localhost)
client_id:YYYYY
client_secret:ZZZZZZ
scope:https://www.googleapis.com/auth/analytics
grant_type:authorization_code
And got error
{
"error": "invalid_grant",
"error_description": "Bad Request"
}
How should I set grant for Postman? Could you help me to resolve issue and understand what I do wrong
I managed to resolve my issue. It should be added redirect_url https://www.getpostman.com/oauth2/callback

Google redirect uri missmatch - server back-end auth code exchange to Access Token

I try to build below:
by following: this steps
and i use oauth playground to generate auth code and load it into my server manually (for testing purpose)
i did put in Authorised redirect URIs : https://developers.google.com/oauthplayground and try to get my auth code this way.
then i load my auth code generated from playground to my REST API Server (http://localhost:5000/api/user/blah) and use this python snippet to exchange the code:
try:
credentials = client.credentials_from_clientsecrets_and_code(
app.config.get('GG_APP_SECRET'),
['https://www.googleapis.com/auth/plus.me', 'profile', 'email'],
req_gg_code)
except Exception as e:
log.info('>>>>> Exception: %s <<<<<', e)
return generate_response(code=400, error=False, type='Fail', message=str(e))
and the result: i keep receive error:
oauth2client.client - INFO - Failed to retrieve access token: b'{\n
"error" : "redirect_uri_mismatch"\n}'
my REST API server doesnt have any interface, it will just receive feed from other client (e.g. mobile app) and it doesnt have any redirect uri.
so what's wrong here? what is the correct configuration of my web client id?
at the moment i'm using web client id (type: web application) with redirect uri: https://developers.google.com/oauthplayground

Resources