Android Refresh token with Retrofit, OkHttp, Kotlin Coroutines Mutex π When multiple requests hit 401 (HTTP_UNAUTHORIZED), only single Refresh token request will be executed. After successful refresh, all pending requests will be executed concurrently. Example of encryption Jetpack Proto DataStore with Tink. Secured Proto DataStore. This exampleβ¦
A simple app to hit the NY Times Most Popular Articles API and show a list of articles, that shows details when items on the list are tapped (a typical master/detail app), also user able to browse/ add articles to favorite list that implements MVVM architecture using Dagger2, Retrofit, Coroutines, LiveData, RoomDatabase, Database Debugging, Dataβ¦
Liked some of my work? Buy me a coffee (or more likely a beer)
Features
β Refresh token only once for multiple requests
β Log out user if refreshToken failed
β Log out if user gets an error after first refreshing
β Queue all requests while token is being refreshed
Run local server
cd server
npm i
npm run start
Change baseUrl (e.g. http://YOUR_ID_ADDRESS:3000/) at app/src/main/java/com/hoc081098/refreshtokensample/data/DataModule.kt
Change expiresIn (default value is 1 minute) at server/routes/index.js.
Find this repository useful? β€οΈ
Star this repository and follow me for next creations! Thanks for your support ππ.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].