I'm trying to upload a video on youtube using google-api-php-client but after all the process I have done. I had to authorize following a link (authorize access) and on localhost its generating the error 400. Error: redirect_uri_mismatch
and says,
The redirect URI in the request, http://localhost/youtubeVideoUpload/upload.php, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs,;
I want to ask that
Firstly how can I solve this issue;
Secondly Is there any way that I can authorize any remote user to upload video on my youtube channel using php
Authorization Required
You need to authorize access before proceeding.
Related
I am using Facebook PHP-SDK v5 with Facebook Graph API v2.10 and by other code i am able to get data from facebook page easily, but what i need is to fetch data of user profile wall ,
from facebook Graph Explorer i am able to read those data by generating token. but not by code.
it will throwing error
URL blocked: This redirect failed because the redirect URI is not white-listed in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs.
and i have used localhost url in the app oAuth setting as well,
I wanted to read someones wall post feed after authorize him by my applications, i dont want to read my own profile like api('/me/feed'
does anyone help me in this case.
Previously I had a working php script that uses the Zend_Gdata_ClientLogin Object to authenticate and make requests on my behalf to delete videos from my YouTube channel. Apparently, this has been deprecated because I get an error and read this: zend gdata and google spreadsheet not connecting
And I get an error which says no longer available. So I've been researching how to use YouTube API v3. Initially I created a service account via the Google developer console.
However I found this
YouTube API v3 with OAuth2: update and delete fail with "Insufficient Permission" error
Which states:
For the uninitiated, the YouTube Data API (v3) does not support
"service accounts,"
And I need to manually obtain a refresh token, to make requests?
Is this still the case? Surely, there must be an easier way to make authenticated requests to the YouTube API where the only client is my server?
If this is still true, how long will the refresh token work? Is this the best practice?
You can check out the documentation to see the most up to date way to request the access token. When the access token expires, your application can refresh it by sending a POST request to Google's authorization server using the refresh token. You only need to get this refresh token once in order to refresh your access token, not every time you want to make authenticated requests, if that's what you were thinking.
The refresh token should be valid unless:
The user has revoked access.
The token has not been used for six months.
The user account has exceeded a certain number of token requests.
There is currently a 25-token limit per Google user account, so if your application requests too many refresh tokens, it may run into this limit and older refresh tokens will stop working.
I can't speak as to whether this is the best way of doing it, but I assume the developers chose this way for a reason.
I would like user upload video to youtube via my web site. I want to user upload on my youtube channel. But oAuth require user google/youtube login.
Is there a solution without OAuth?
You can't upload to Youtube video without login (via the browser or via oAuth).
You can no longer use the YouTube API to upload to YouTube without using OAuth. "ClientLogin" is no longer supported.
I am trying to upload video on youtube channel from my site(created in php), without user authentication. I am using "youtube v3 API".
Reference: https://developers.google.com/youtube/v3/
Reference: https://developers.google.com/youtube/v3/guides/authentication
But it requires user authentication for uploading.
Question1: Is there any way to upload video on youtube without user authentication?
Question2: I need to know how can we implement this by browser based uploading(i.e. upload directly on youtube server) ?
No, you cannot upload videos without user authentication.
It's not possible either. You need remote server so you could connect to YT.
Scenario:
Someone comes to my website and they see a file select field. They select the file and upload the file to MY Google Drive account.
Problem:
In looking at the Google Drive SDK docs I see that it uses OAuth for authentication, but I don't need to authenticate the user because they are uploading to MY Google Drive account. I'm aware that I need to register my application with Google, etc. but I'd like to know if I can upload without authorizing the user with OAuth the typical way (sending offsite or modal window to validate w/ redirect URL).
Is this possible to do? I'm using PHP.
You have two options:-
Use a Service Account. The files will be uploaded to the account of the Service Account
Use a regular Google account. For this option, you (as the account owner) will need to do a one-off auth to get a refresh token, which you will store. You can then use this any time to generate the access token needed to invoke the actual Drive API. You can generate the refresh token using the Oauth Playground, so no need to write any code.
See How do I authorise an app (web or installed) without user intervention? (canonical ?)