martinbean / socialite-discord-provider

A Discord provider for Laravel Socialite.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't seem to get this working

dotangad opened this issue · comments

I have Google OAuth working perfectly, however I get a 401 Unauthorized when I'm trying to fetch the Discord user from the callback.

Route::get('/auth/discord', function () {
    return Socialite::driver('discord')->redirect();
});

Route::get('/auth/discord/cb', function () {
    try {
        $user = Socialite::driver('discord')->user();
        dd($user);
        return;
    } catch (Exception $e) {
        dd($e);
        return Redirect::to('/auth/discord');
    }
});

Here's the error message -

    Client error: `POST https://discord.com/api/oauth2/token` resulted in a `401 Unauthorized` response:
    {"error": "invalid_client"}

image

I just got this working, by the looks of it your client or secret isnt set.