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

i have an error #4

Open
Solovic2 opened this issue Sep 30, 2020 · 2 comments
Open

i have an error #4

Solovic2 opened this issue Sep 30, 2020 · 2 comments

Comments

@Solovic2
Copy link

hello sir ,
when i use first step when i call youtube/auth , after signing in , it redirect back and show me this error

Capture

the error is : " GuzzleHttp\Exception\ClientException
Client error: POST https://oauth2.googleapis.com/token resulted in a 400 Bad Request response: { "error": "redirect_uri_mismatch", "error_description": "Bad Request" } " .

i put the second route with method ( callback ) and the error i think from third line

public function callback(Request $request){

    $redirect_url ='http://localhost/proj/public/youtube/callback';
    $video = puplic_path('video\1.mp4');    // i made a folder called video and put one from my computer

> $youtube = Youtube::setRedirectUrl($redirect_url)->upload($video,[]);`

    // Get uploaded video id
    return   $video_id = $youtube->uploadedVideoId();
}

what should i do ?

thanks sir .

@arm092
Copy link
Owner

arm092 commented Oct 1, 2020

Hi dear
Go to your Google Developers Console > Then go to API Manager > Click on the Credentials > Go to your Web Client Service. You'll see clientid and client secret. Below there somewhere you'll find Authorized redirect URI. Just add your redirect uri for eg. `www.example.com/oauth'. Now google will use one of the listed redirect uri. It will fix your problem.

It is not package's problem. Try to search problem solving on the stackoverflow.

@Solovic2
Copy link
Author

Solovic2 commented Oct 1, 2020

thanks sir for replying , i'm beginner with laravel so please care of me , i did what u wrote , but same problem with me , it send with my url in request { code & scope &state } after i sign in , but when use callback function which upload video , it says same thing which i put above .

my try is :

making clientId ,client secret .

save , and put it in my env file .

make Authorized redirect URI >> http://localhost/proj/public/myown .

run composer require arm092/laravel-youtuber .

in my view i put
Route::get('youtube/auth', 'YoutubeUploaderController@auth');
Route::get('youtube/callback', 'YoutubeUploaderController@callback'); `

in my controler ( YoutubeUploaderController ) i make methods.

in my web site , i run http://localhost/proj/public/youtube/auth and signing in ,it redirect to http://localhost/proj/public/myown/... with request ( code=.. & scope=.. & state=.. ) , but , it show me same problem
i tried to make another route and view with form to submit from that link http://localhost/proj/public/myown/... , it says i should be authorized .

so what i should to do ?

I hope i didn't disturb you , thanks sir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants