antihax / goesi

Go client for EVE Online ESI and SSO using versioned endpoints
MIT License
79 stars 13 forks source link

How should I refresh tokens? #8

Closed dancodes closed 6 years ago

dancodes commented 6 years ago

I've successfully set up a small application that fetches EVE mails, the easy to read methods are useful, so great job.

When I authenticate with SSO, I get an access token and a refresh token, both which I then store. However, when I try to do an ESI call after more than 1200 seconds, I get an {"error": "expired", "sso_status": 400} response.

Wasn't the library supposed to automatically refresh this token? If not, how should I proceed?

Thanks!

antihax commented 6 years ago

Can you post some code? Tokensource should refresh the token if it expired.

dancodes commented 6 years ago

My mistake: I was manually creating the oauth2.Token objects and did not set an Expiry attribute to them. Closing this.

Great library btw, thanks a lot!