Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetAccessToken Method while Authorization is not working #133

Open
300ms opened this issue Jul 15, 2020 · 0 comments
Open

SetAccessToken Method while Authorization is not working #133

300ms opened this issue Jul 15, 2020 · 0 comments

Comments

@300ms
Copy link

300ms commented Jul 15, 2020

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant