mardi 24 avril 2018

Laravel - Invalid appsecret_proof provided in the API argument

I'm Facebook problem using Facebook socialite driver as it give me Invalid appsecret_proof provided in the API argument.

I've already include my facebook app id and apps secret in my .env file and still the issue persist. If i've to setup the app secret_proof, where should I set it ?

Below is my composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.6.*",
        "laravel/passport": "^6.0",
        "laravel/socialite": "^3.0",
        "laravel/tinker": "^1.0"
    },
    "require-dev": {
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

And below is my controller, I get the token from https://developers.facebook.com/tools/explorer/

public function facebookLogin(Request $request)
    {
        $token = 'xxxxxxxxxxxxxxxxxxxxxxx';
        $request_field = ['id','email','name'];
        $facebook_account = Socialite::driver('facebook')
            ->fields($request_field)
            ->userFromToken($token);

        return response()->json($facebook_account);
    }

Any help would be greatly appreciated..



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire