-
Notifications
You must be signed in to change notification settings - Fork 80
Description
My problem is about trading authorization code with an Access Token in a nodejs app.
I was trying to follow your documentation https://github.com/vimeo/vimeo.js on here. I am creating client object as;
var Vimeo = require('vimeo').Vimeo;
var client = new Vimeo(CLIENT_ID, CLIENT_SECRET);
without an access token because i am going to generate one for user. I am generating the url as;
var url = client.buildAuthorizationEndpoint(redirect_uri, scopes, state);
and then opening the link in my browser. Then i get the code and state in url and enter them into console manually by prompt.sync . Then i use client.accessToken to trade the code with Access Token but it is not assigning the response.access_token into client by setAccessToken method. I have the response and response.access_token and i can print them out on the console but it's value cannot be assigned into client.
I am sending a simple request to get my videos by client.request after that and i get " Error: {"error":"You must provide a valid authenticated access token."} " error. Also when i print out Client object, there are only CLIENT_ID and CLIENT_SECRET attributes. There is nothing else. ACCESS_TOKEN is not there.
Can you help me about this problem please ? I also had similar problem about authentication while trying it in a powershell script. And i couldn't make it too due to "Unsupported grant type" error while trying to trade code with an Access Token, even my grant_type attributes parameter is "authorization_code".