All Projects β†’ hoc081098 β†’ Refresh-Token-Sample

hoc081098 / Refresh-Token-Sample

Licence: MIT license
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…

Programming Languages

kotlin
9241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Refresh-Token-Sample

StateFlow-MVVM-MVI-demo
Using StateFlow as LiveData | StateFlow instead of LiveData | LiveData to StateFlow | StateFlow MVVM | StateFlow sample | StateFlow demo
Stars: ✭ 144 (+102.82%)
Mutual labels:  kotlin-coroutines-mvvm, kotlin-coroutine-flow, kotlin-coroutines-stateflow
LiveData
Android Architecture Component - LiveData example
Stars: ✭ 18 (-74.65%)
Mutual labels:  android-retrofit
Chucker
πŸ”Ž An HTTP inspector for Android & OkHTTP (like Charles but on device)
Stars: ✭ 2,169 (+2954.93%)
Mutual labels:  okhttp-interceptor
finch
πŸ–₯ Debug menu library for Android apps with supports network activity logging and many other useful features.
Stars: ✭ 42 (-40.85%)
Mutual labels:  okhttp-interceptor
NYTimesMostPopularArticles
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…
Stars: ✭ 38 (-46.48%)
Mutual labels:  kotlin-coroutines-mvvm
android-clean-arc-coroutines
Clean Architecture(Coroutines,Dagger, MVVM, ROOM, retrofit, databinding)
Stars: ✭ 116 (+63.38%)
Mutual labels:  kotlin-coroutines-mvvm

Android Refresh Token Sample πŸ”‚

  • Android Refresh token with Retrofit, OkHttp and 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.
  • Store user and token using Proto DataStore from Jetpack.
  • This example app shows how you can encrypt your data when using Proto DataStore from Jetpack.

API Kotlin Build CI Hits License: MIT

Buy me a coffee

Liked some of my work? Buy me a coffee (or more likely a beer)

"Buy Me A Coffee"

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].