1

I have successfully set up the feedly developer access token using the javascript library Axios on a NuxtJS site. I am having trouble, though, figuring out how to set up the refresh token.

This is the process I have used for the developer token

export default function({ $axios }) {
  $axios.onRequest((config) => {
    config.headers.common['Authorization'] = [FEEDLY_ACCESS_TOKEN]
  })
}

This code gets run whenever I make the relevant axios request.

What I am wondering, now, is what I need to do for the refresh token. I have taken a look at the instructions on these two pages:

However, I'm still not 100% clear as to what I am supposed to do. In particular, I have two questions:

  1. Do I also run the refresh token each time I make an axios call -- or should I create a function that runs every thirty days and runs the code.

  2. How exactly do I make the axios call for the refresh token. My initial guess is something like this:

$axios.$post('https://cloud.feedly.com/v3/auth/token/?refresh_token=FEEDLY_REFRESH_TOKEN&client_id=feedlydev&client_secret=feedlydev&grant_type=refresh_token')

Is that correct? If not, what do I need to change.

Thanks.

Moshe
  • 6,011
  • 16
  • 60
  • 112

1 Answers1

0

Different developers will use different strategie regarding refreshing an access token. While some will return a new token on every request, other will do it over a term of days or longer.
The idea is to reduce the window of risk in which an access token can be abused but it is sort of a subjective topic imo. Obviously there is a performance penalty when you generate a new access token on every request. Sometimes this may be acceptable, but I really don't think it's necessary in many cases. Measure the tradeoff between the penalty and the sensitivity of the token in your case.

The docs explain it well:

Endpoint:

POST /v3/auth/token

It does say that using url parameters is not recommended, so why not just do it the way they recommend it? Either:

  • using a x-www-form-urlencoded POST request (standard)
  • as a JSON object (make sure you set the Content-Type header to “application/json”)

You have more questions around this?

html_programmer
  • 18,126
  • 18
  • 85
  • 158