Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View Vimeo private video with an OAuth token

Can anyone give a help in Vimeo API using scribe? My goal is to access a private video (which I uploaded) without having to force the user to put password (this process should be done in background).

From what I understand / deduce from research is necessary:

  1. Request for application authorization using oAuth protocol and via the following link:

    https://vimeo.com/oauth/authorize?oauth_token=XXXX

    This operation is performed successfully and response data are sent to callback URL, something like:

    http://127.0.0.1:8001/XPTO.html?oauth_token=AUTH_TOKEN_EXAMPLE&oauth_verifier=VERIFIIER__EXAMPLE"

  2. According to Brad Dougherty (Vimeo API Staff) it´s possible do something like that

    If you go through the OAuth process as yourself, you can save that token and use that to make the calls.

I'm using this code:

service = new ServiceBuilder().provider(VimeoApi.class)                 .apiKey("API_KEY_EXAMPLE")                 .apiSecret("API_SECRET_EXAMPLE")                 .build();  OAuthRequest request = new OAuthRequest(Verb.GET,         "http://vimeo.com/api/rest/v2?video_id=50305416");  request.addQuerystringParameter("format", "json"); request.addQuerystringParameter("method", "vimeo.videos.getInfo");  String oauth_verifier=VERIFIER__EXAMPLE; Verifier verifier = new Verifier(oauth_verifier);  //I've tried differents combination to create this token //I believe that my problem is HERE //One unsuccessfully try: Token requestToken = service.getRequestToken(); Token requestToken = new Token(         AUTH_TOKEN_EXAMPLE,         API_SECRET_EXAMPLE);  Token token = service.getAccessToken(requestToken, verifier);  service.signRequest(token, request);  Response response = request.send(); 

I've the following error:

Response body is incorrect. Can't extract token and secret from this: '401 Unauthorized - Invalid signature - The oauth_signature passed was not valid.'

What's escaping me? This is the correct way to do it, right?

like image 856
JMarques Avatar asked Sep 28 '12 15:09

JMarques


People also ask

How do I get an access token on Vimeo?

Go to your Apps page. Select the app you want to authenticate with. Click Generate Access Token in the left-hand navigation column. Select Authenticated (you) if you need to interact with private data on your account; select Unauthenticated if you only need to read metadata public on vimeo.com.

How do I view hidden videos on Vimeo?

On your computer or laptop, log in to your Vimeo account. In your email program, open the email message that has the vimeo link to your private video. Open the video, enter the password. On the top right corner of the video, click the Clock Icon to Add To Watch Later list.

Can you share private Vimeo videos?

A showcase can be set to public, or you can add a password to it. Like with your individual videos, anyone you share the private showcase's link and password with can share it with anyone else.

How do I get client ID and client secret on Vimeo?

To get the client identifier and client secret for the Authorization header, go to My Apps, and open your app's information page. In the body of the request, set the user_code field to the user code and the device_code field to the device code.


1 Answers

Another way of keeping your video private is to change in the "Privacy / Settings" the option Only people with a password, to "Hide this video from Vimeo.com" and "Only on sites I choose".

The reason you might benefit from this is that you have control over the sites that can embed the video. You could even use a normal iframe embed on your app and skip the whole API call if what you want is to show your video on your site and nowhere else. But if you still need to make the call through the API, at least you don't have the password problem.

This does not answer your question directly, but is an alternative approach to solving the problem.

like image 128
1cgonza Avatar answered Sep 28 '22 03:09

1cgonza