SweetzpotAS / StravaZpot-Android

A fluent API to integrate with Strava on Android apps
70 stars 36 forks source link

Question abut token #12

Open mstaniszczak opened 6 years ago

mstaniszczak commented 6 years ago

In application I should store token and use it in future for calls to Strava, or I should store code, and obtain token at lest on every new start of app? With sore token is problem, tat you not allow to access it via your class;-) I can remove "Bearer" from string representation of token but...

Edit: like I see for example in Strava library for python, they suggest to store token. So maybe getTokien will be good idea?;-) I can also serialize Token object:)

alessionunzi commented 6 years ago

You need to store the token so that it can be used for any future request. You also need to remove it when the StravaUnauthorizedException is thrown because it means the token is no longer valid and the user must authenticate again.