400 Error: redirect_uri_mismatch for yotube video upload

这一生的挚爱 提交于 2019-12-25 16:37:07

问题


I am implementing functionality for uploading video's to a YouTube channel from here.

I set up my Google Developer console environment exactly like suggested.

I also use the same client Id and client secret that it gave me. When I run the script it returns with an error.

  1. That’s an error. Error: redirect_uri_mismatch Application: Localhost You can email the developer of this application at: XXXXX@gmail.com The redirect URI in the request: http://localhost/youtube/index.php did not match a registered redirect URI.

Request Details

scope=https://www.googleapis.com/auth/youtube
response_type=code
access_type=online
redirect_uri=http://localhost/youtube/index.php
pageId=none
approval_prompt=auto
state=2067416475
client_id=xxxxxx68kc7csrag9as2o3lv70k0spa6hfb1ofs4.apps.googleusercontent

I don't understand the problem.


回答1:


Redirect URI in the Google developers console states

One URI per line. Needs to have a protocol, no URL fragments, and no relative paths. Can't be a public IP Address.

You have set yours to

http://localhost/youtube

you should set it to

http://localhost/youtube/index.php

Redirect URI must be set to the path to the exact file which will handle the authentication.

Note: Also you will now want to delete that one because you need to keep your client id and client secret private you just shared it with everyone.



来源:https://stackoverflow.com/questions/30346233/400-error-redirect-uri-mismatch-for-yotube-video-upload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!