-
Notifications
You must be signed in to change notification settings - Fork 73
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
In the Node.js example what is the correct way to prevent having to authenticate via an url every script restart? #143
Comments
So seems like I can get it via: const res = await client.authorize()
console.log(res.dispatcher.authenticator)
Is this correct? Also, calling |
I think I follow what you're asking here, let me try to send you along the right path! When you go through the oauth flow, basically the idea is that there are 3 actors: the user, your app, and Asana. The flow you're likely looking for is here.
So, basically, you actually use the When you do the token exchange, take a look at the credentials that come back (just as you logged to console is fine) - I believe you should have the If you look at the useOauth() function, you can see that it takes some options. If you pass it credentials, you should be able to keep using the ones you have stored. I believe all you have to do then is pass in the credential for Hopefully this gets you unblocked - we should perhaps show more than just the original code exchange in our examples to show starting from scratch with a saved refresh token. OAuth is messy and kind of hard, so I hope this makes a bit more sense! |
What is the correct way to obtain the
access_token
in aNativeFlow
auth?You follow an url and get a code. Then you are asked to type the code into a prompt. But then how can I get the accessToken (I am assuming that somewhere
client.app.accessTokenFromCode
is being run - but where are the credentials?).The text was updated successfully, but these errors were encountered: