Hi All,
I wanted to get the OAuth token to access you tube private videos.
I am using Account Manager class to get the access token for the
account logged in on device using "com.google. "
I'm assuming you're making the HTTP requests yourself rather than
using the Java client library, since the existing library doesn't work
well on Android. So you'd want to either include the token in the
request URL or set the Authorization HTTP header.
Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev
On May 24, 5:55 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote:
> Hi All,
> I wanted to get the OAuth token to access you tube private videos.
> I am using Account Manager class to get the access token for the
> account logged in on device using "com.google. "
After getting the authentication token i send the http request as
<code>
HttpClient lClient = new DefaultHttpClient();
String postReq = ("
https://gdata.youtube.com/feeds/api/users/default/uploads?access_token=" +
my_access_token);
HttpPost lPostMethod = null;
lPostMethod = new HttpPost(postReq);
lPostMethod.addHeader("Authorization:Bearer", finalToken);
HttpResponse lResp = null;
lResp = lClient.execute(lPostMethod);
lResp.getEntity().writeTo(lBOS);
Log.i("RESP", lInfoStr);
</code>
The lInfoStr gives the output as "Response contains no content type"
What needs to be done after this??
Also, if i use the same "my_access_token" it cannot extract details(play
private video).
I did not see any information of how to set the "client id" "client secret"
for the access token acquired by accounts manager. (for you tube which link
to be used)
The access token acquired by Account Manager and by OAuth2.0 request as
mentioned in the below link do not match.
The details mentioned for getting an access token for Installed application
as described in:
does not mention how to get the access token acquired by account manager on
the device
(and for the method mentioned above requires to open a web View but i want
to do this process without user interaction)
I am still stuck and want to get the you tube access to play the private
videos by using the access token acquired by accounts manager on the device
> I'm assuming you're making the HTTP requests yourself rather than
> using the Java client library, since the existing library doesn't work
> well on Android. So you'd want to either include the token in the
> request URL or set the Authorization HTTP header.
> Cheers,
> -Jeff Posnick, YouTube API Team
> groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> @YouTubeDev
> On May 24, 5:55 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote:
> > Hi All,
> > I wanted to get the OAuth token to access you tube private videos.
> > I am using Account Manager class to get the access token for the
> > account logged in on device using "com.google. "
> > I am unaware as to how to use the access token received from Account
> > Manager and pass it to You tube for actual authentication.
> > Or can i use the Token Directly??
> > Regards,
> > Sudhish Kapoor
> --
> You received this message because you are subscribed to the Google Groups
> "YouTube APIs Developer Forum" group.
> To post to this group, send email to youtube-api-gdata@googlegroups.com.
> To unsubscribe from this group, send email to
> youtube-api-gdata+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/youtube-api-gdata?hl=en.
Let's take a big step back here. You say your end goal is to play
private videos, but that's a complicated subject on the web-based
embedded player (it relies on the YouTube.com login cookie being
present, which has nothing to do with the Data API) and and even more
complicated subject, and potentially not possible, from an Android
application.
How were you planning on playing the video?
Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev
On May 27, 1:39 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote:
> After getting the authentication token i send the http request as
> <code>
> HttpClient lClient = new DefaultHttpClient();
> String postReq = ("https://gdata.youtube.com/feeds/api/users/default/uploads?access_token=" +
> my_access_token);
> HttpPost lPostMethod = null;
> lPostMethod = new HttpPost(postReq);
> lPostMethod.addHeader("Authorization:Bearer", finalToken);
> HttpResponse lResp = null;
> lResp = lClient.execute(lPostMethod);
> lResp.getEntity().writeTo(lBOS);
> Log.i("RESP", lInfoStr);
> </code>
> The lInfoStr gives the output as "Response contains no content type"
> What needs to be done after this??
> Also, if i use the same "my_access_token" it cannot extract details(play
> private video).
> I did not see any information of how to set the "client id" "client secret"
> for the access token acquired by accounts manager. (for you tube which link
> to be used)
> The access token acquired by Account Manager and by OAuth2.0 request as
> mentioned in the below link do not match.
> The details mentioned for getting an access token for Installed application
> as described in:
> does not mention how to get the access token acquired by account manager on
> the device
> (and for the method mentioned above requires to open a web View but i want
> to do this process without user interaction)
> I am still stuck and want to get the you tube access to play the private
> videos by using the access token acquired by accounts manager on the device
> > I'm assuming you're making the HTTP requests yourself rather than
> > using the Java client library, since the existing library doesn't work
> > well on Android. So you'd want to either include the token in the
> > request URL or set the Authorization HTTP header.
> > Cheers,
> > -Jeff Posnick, YouTube API Team
> > groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> > @YouTubeDev
> > On May 24, 5:55 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote:
> > > Hi All,
> > > I wanted to get the OAuth token to access you tube private videos.
> > > I am using Account Manager class to get the access token for the
> > > account logged in on device using "com.google. "
> > > I am unaware as to how to use the access token received from Account
> > > Manager and pass it to You tube for actual authentication.
> > > Or can i use the Token Directly??
> > > Regards,
> > > Sudhish Kapoor
> > --
> > You received this message because you are subscribed to the Google Groups
> > "YouTube APIs Developer Forum" group.
> > To post to this group, send email to youtube-api-gdata@googlegroups.com.
> > To unsubscribe from this group, send email to
> > youtube-api-gdata+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/youtube-api-gdata?hl=en.
I am actually trying to do about the same as Sudhish regarding the authentification. I would like to be able to get the youtube recommendation for a specific user. Could you provide some details about it? eg the parameters
On Wednesday, May 30, 2012 7:15:04 AM UTC+10, Jeffrey Posnick wrote:
> Hello Sudhish,
> Let's take a big step back here. You say your end goal is to play > private videos, but that's a complicated subject on the web-based > embedded player (it relies on the YouTube.com login cookie being > present, which has nothing to do with the Data API) and and even more > complicated subject, and potentially not possible, from an Android > application.
> How were you planning on playing the video?
> Cheers, > -Jeff Posnick, YouTube API Team > groups.google.com/group/youtube-api-gdata | apiblog.youtube.com | > @YouTubeDev
> On May 27, 1:39 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote: > > Hi Jeff, > > I get an Authorization token by using the function
> > The lInfoStr gives the output as "Response contains no content type"
> > What needs to be done after this??
> > Also, if i use the same "my_access_token" it cannot extract details(play > > private video).
> > I did not see any information of how to set the "client id" "client > secret" > > for the access token acquired by accounts manager. (for you tube which > link > > to be used)
> > The access token acquired by Account Manager and by OAuth2.0 request as > > mentioned in the below link do not match.
> > The details mentioned for getting an access token for Installed > application > > as described in:
> > does not mention how to get the access token acquired by account manager > on > > the device > > (and for the method mentioned above requires to open a web View but i > want > > to do this process without user interaction)
> > I am still stuck and want to get the you tube access to play the private > > videos by using the access token acquired by accounts manager on the > device
> > 1) Get auth_token from account Manger from device > > 2) Use the auth token to get the access for You tube. > > 3) Play the private video using " > http://www.youtube.com/get_video_info?&video_id=xxxxxx&access_token=m... > > " > > 4) Do all this in without user interaction.
> > How to do this??
> > Regards, > > Sudhish Kapoor
> > On Sat, May 26, 2012 at 1:29 AM, Jeffrey Posnick <je...@google.com> > wrote: > > > Hello Sudhish,
> > > If you get back a valid OAuth 2 token, you need to use it as > > > described at
> > > I'm assuming you're making the HTTP requests yourself rather than > > > using the Java client library, since the existing library doesn't work > > > well on Android. So you'd want to either include the token in the > > > request URL or set the Authorization HTTP header.
> > > On May 24, 5:55 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote: > > > > Hi All, > > > > I wanted to get the OAuth token to access you tube private videos. > > > > I am using Account Manager class to get the access token for the > > > > account logged in on device using "com.google. "
> > > > I am unaware as to how to use the access token received from Account > > > > Manager and pass it to You tube for actual authentication.
> > > > Or can i use the Token Directly??
> > > > Regards, > > > > Sudhish Kapoor
> > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "YouTube APIs Developer Forum" group. > > > To post to this group, send email to > youtube-api-gdata@googlegroups.com. > > > To unsubscribe from this group, send email to > > > youtube-api-gdata+unsubscribe@googlegroups.com. > > > For more options, visit this group at > > >http://groups.google.com/group/youtube-api-gdata?hl=en.
On Wednesday, July 11, 2012 2:45:03 AM UTC-4, Yorick Maziere wrote:
> Hello Jeffrey,
> I am actually trying to do about the same as Sudhish regarding the > authentification. I would like to be able to get the youtube recommendation > for a specific user. Could you provide some details about it? eg the > parameters
> Thanks in advance. > Yorick
> On Wednesday, May 30, 2012 7:15:04 AM UTC+10, Jeffrey Posnick wrote:
>> Hello Sudhish,
>> Let's take a big step back here. You say your end goal is to play >> private videos, but that's a complicated subject on the web-based >> embedded player (it relies on the YouTube.com login cookie being >> present, which has nothing to do with the Data API) and and even more >> complicated subject, and potentially not possible, from an Android >> application.
>> How were you planning on playing the video?
>> Cheers, >> -Jeff Posnick, YouTube API Team >> groups.google.com/group/youtube-api-gdata | apiblog.youtube.com | >> @YouTubeDev
>> On May 27, 1:39 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote: >> > Hi Jeff, >> > I get an Authorization token by using the function
>> > The lInfoStr gives the output as "Response contains no content type"
>> > What needs to be done after this??
>> > Also, if i use the same "my_access_token" it cannot extract >> details(play >> > private video).
>> > I did not see any information of how to set the "client id" "client >> secret" >> > for the access token acquired by accounts manager. (for you tube which >> link >> > to be used)
>> > The access token acquired by Account Manager and by OAuth2.0 request as >> > mentioned in the below link do not match.
>> > The details mentioned for getting an access token for Installed >> application >> > as described in:
>> > does not mention how to get the access token acquired by account >> manager on >> > the device >> > (and for the method mentioned above requires to open a web View but i >> want >> > to do this process without user interaction)
>> > I am still stuck and want to get the you tube access to play the >> private >> > videos by using the access token acquired by accounts manager on the >> device
>> > 1) Get auth_token from account Manger from device >> > 2) Use the auth token to get the access for You tube. >> > 3) Play the private video using " >> http://www.youtube.com/get_video_info?&video_id=xxxxxx&access_token=m... >> > " >> > 4) Do all this in without user interaction.
>> > How to do this??
>> > Regards, >> > Sudhish Kapoor
>> > On Sat, May 26, 2012 at 1:29 AM, Jeffrey Posnick <je...@google.com> >> wrote: >> > > Hello Sudhish,
>> > > If you get back a valid OAuth 2 token, you need to use it as >> > > described at
>> > > I'm assuming you're making the HTTP requests yourself rather than >> > > using the Java client library, since the existing library doesn't >> work >> > > well on Android. So you'd want to either include the token in the >> > > request URL or set the Authorization HTTP header.
>> > > On May 24, 5:55 am, sudhish kapoor <kapoorsudh...@gmail.com> wrote: >> > > > Hi All, >> > > > I wanted to get the OAuth token to access you tube private >> videos. >> > > > I am using Account Manager class to get the access token for the >> > > > account logged in on device using "com.google. "
>> > > > I am unaware as to how to use the access token received from >> Account >> > > > Manager and pass it to You tube for actual authentication.
>> > > > Or can i use the Token Directly??
>> > > > Regards, >> > > > Sudhish Kapoor
>> > > -- >> > > You received this message because you are subscribed to the Google >> Groups >> > > "YouTube APIs Developer Forum" group. >> > > To post to this group, send email to >> youtube-api-gdata@googlegroups.com. >> > > To unsubscribe from this group, send email to >> > > youtube-api-gdata+unsubscribe@googlegroups.com. >> > > For more options, visit this group at >> > >http://groups.google.com/group/youtube-api-gdata?hl=en.