When I open up the app after a few hours of inactivity (say before bed the night before and then in the morning) the app is logged out and shows me the log-in screen with my URL, username pre-filled, and blank password box. There is an error saying "no refresh token available".
The "Login with Authentik" box is not visible, the only workaround is to click the trashcan to delete the stored credentials, enter the URL again and log in again.
Steps to Reproduce the Issue
Configure ABS with Authentik for Login
Log in using Authentik (or probably any SSO)
Wait until JWT expires (guessing??)
Open app
See error
What was Expected?
My login session would continue like it did before the auth refactor.
Additionally if there's an error with my session/credentials, present me with the "login with authentik" button again, that button should always be present.
Phone Model
iPhone 15 Pro
Phone OS
18.5
Audiobookshelf App Version
iOS App - 0.10.0
Installation Source
Testflight
Additional Notes
ABS Server: 2.26.2
Authentik: 2025.6.3
Originally created by @tebriel on GitHub (Jul 22, 2025).
### I have verified that the [bug is not already awaiting release](https://github.com/advplyr/audiobookshelf-app/issues?q=is%3Aissue%20label%3A%22awaiting%20release%22)
Yes
### What was the Problem?
When I open up the app after a few hours of inactivity (say before bed the night before and then in the morning) the app is logged out and shows me the log-in screen with my URL, username pre-filled, and blank password box. There is an error saying "no refresh token available".
The "Login with Authentik" box is _not_ visible, the only workaround is to click the trashcan to delete the stored credentials, enter the URL again and log in again.
### Steps to Reproduce the Issue
1. Configure ABS with Authentik for Login
2. Log in using Authentik (or probably any SSO)
3. Wait until JWT expires (guessing??)
4. Open app
5. See error
### What was Expected?
My login session would continue like it did before the auth refactor.
Additionally if there's an error with my session/credentials, present me with the "login with authentik" button again, that button should always be present.
### Phone Model
iPhone 15 Pro
### Phone OS
18.5
### Audiobookshelf App Version
iOS App - 0.10.0
### Installation Source
Testflight
### Additional Notes
ABS Server: 2.26.2
Authentik: 2025.6.3
adam
added the bug label 2026-04-24 23:55:02 +02:00
Can you try configuring a separate user that uses password authentication so we can check if the issue is related to the OIDC endpoint not returning a refresh token?
The iOS app doesn't have the logger that the Android app has yet so it will be hard to debug without seeing the logs on whether the refresh token was saved to secure storage.
@advplyr commented on GitHub (Jul 22, 2025):
Can you try configuring a separate user that uses password authentication so we can check if the issue is related to the OIDC endpoint not returning a refresh token?
The iOS app doesn't have the logger that the Android app has yet so it will be hard to debug without seeing the logs on whether the refresh token was saved to secure storage.
The access token expiration is default to 12h but can be overridden by an env variable ACCESS_TOKEN_EXPIRY: Access token expiration in seconds (initial default: 43200 = 12 hours) REFRESH_TOKEN_EXPIRY: Refresh token expiration in seconds (initial default: 604800 = 7 days)
@advplyr commented on GitHub (Jul 22, 2025):
The access token expiration is default to 12h but can be overridden by an env variable
`ACCESS_TOKEN_EXPIRY`: Access token expiration in seconds (initial default: 43200 = 12 hours)
`REFRESH_TOKEN_EXPIRY`: Refresh token expiration in seconds (initial default: 604800 = 7 days)
Created new user (tebriel-test) with password defined in UI.
Logged in to user in ABS iOS Mobile App using username + password
Force-quit mobile app (to prevent any background refreshing)
Waited 120s
launched app
Error appeared.
End test (saw no need to test further)
@tebriel commented on GitHub (Jul 22, 2025):
@advplyr
Test:
`ACCESS_TOKEN_EXPIRY = 60`
`REFRESH_TOKEN_EXPIRY = 300`
<details>
<summary>Code change documentation in case I need it again</summary>
```nix
systemd.services.audiobookshelf.environment = {
ACCESS_TOKEN_EXPIRY = "60";
REFRESH_TOKEN_EXPIRY = "300";
};
```
</details>
### non-authentik
1. Created new user (tebriel-test) with password defined in UI.
2. Logged in to user in ABS iOS Mobile App using username + password
3. Force-quit mobile app (to prevent any background refreshing)
4. Waited 120s
5. launched app
6. Error appeared.
7. End test (saw no need to test further)
<img width="1179" height="2556" alt="Image" src="https://github.com/user-attachments/assets/ccba7fba-d0bc-4ce5-b0ac-c7b43ee4cdf4" />
server logs, I had a browser window with the logged in user open so this is two sessions. Failed login attempt was me mistyping the password (whoops). So nothing of note on the server side (expected but always helps to check).
server logs
Jul 22 12:37:29 bard audiobookshelf[407653]: [2025-07-22 12:37:29.466] INFO: Listening on http://127.0.0.1:8007
Jul 22 12:37:29 bard audiobookshelf[407653]: [2025-07-22 12:37:29.605] INFO: [SocketAuthority] Socket Connected to /audiobookshelf/socket.io wfdQ43uuHKTQ
fmW_AAAB
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.519] INFO: [SocketAuthority] Socket Connected to /socket.io YTXpc-ocZICitzW2AAAD
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.596] INFO: [Watcher] "Podcasts" Ready
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.742] INFO: [Watcher] "Books" Ready
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.848] INFO: [Watcher] "AudioBooks" Ready
Jul 22 12:37:36 bard audiobookshelf[407653]: [2025-07-22 12:37:36.806] INFO: [SocketAuthority] Socket wfdQ43uuHKTQfmW_AAAB disconnected from client "tebr
iel" after 7201ms (Reason: transport close)
Jul 22 12:37:37 bard audiobookshelf[407653]: [2025-07-22 12:37:37.639] INFO: [SocketAuthority] Socket Connected to /audiobookshelf/socket.io Ct7nnWs9KycF
UaZgAAAF
Jul 22 12:38:32 bard audiobookshelf[407653]: [2025-07-22 12:38:32.821] ERROR: [LocalAuth] Failed login attempt for username "tebriel-test" from ip fd7a:1
15c:a1e0::f201:fc07 (Invalid password)
Jul 22 12:38:43 bard audiobookshelf[407653]: [2025-07-22 12:38:43.464] INFO: [LocalAuth] User "tebriel-test" logged in from ip fd7a:115c:a1e0::f201:fc07
Jul 22 12:38:43 bard audiobookshelf[407653]: [2025-07-22 12:38:43.741] INFO: [SocketAuthority] Socket Connected to /audiobookshelf/socket.io IL6R6BeACI7F
zyMMAAAH
Jul 22 12:38:54 bard audiobookshelf[407653]: [2025-07-22 12:38:54.227] INFO: [SocketAuthority] Socket Connected to /socket.io ZjI95y1XB0E0lpRUAAAJ
Jul 22 12:38:55 bard audiobookshelf[407653]: [2025-07-22 12:38:55.508] INFO: [SocketAuthority] Socket ZjI95y1XB0E0lpRUAAAJ disconnected from client "tebr
iel" after 1281ms (Reason: transport close)
Jul 22 12:39:59 bard audiobookshelf[407653]: [2025-07-22 12:39:59.200] INFO: [LocalAuth] User "tebriel-test" logged in from ip 100.89.170.60
Jul 22 12:39:59 bard audiobookshelf[407653]: [2025-07-22 12:39:59.300] INFO: [SocketAuthority] Socket Connected to /socket.io IAbAI8PgUv2o-gMFAAAL
Jul 22 12:40:06 bard audiobookshelf[407653]: [2025-07-22 12:40:06.389] INFO: [SocketAuthority] Socket IAbAI8PgUv2o-gMFAAAL disconnected from client "tebriel-test" after 7089ms (Reason: transport close)
Jul 22 12:42:21 bard audiobookshelf[407653]: [2025-07-22 12:42:21.900] INFO: Received ping
@tebriel commented on GitHub (Jul 22, 2025):
server logs, I had a browser window with the logged in user open so this is two sessions. Failed login attempt was me mistyping the password (whoops). So nothing of note on the server side (expected but always helps to check).
<details>
<summary>server logs</summary>
```
Jul 22 12:37:29 bard audiobookshelf[407653]: [2025-07-22 12:37:29.466] INFO: Listening on http://127.0.0.1:8007
Jul 22 12:37:29 bard audiobookshelf[407653]: [2025-07-22 12:37:29.605] INFO: [SocketAuthority] Socket Connected to /audiobookshelf/socket.io wfdQ43uuHKTQ
fmW_AAAB
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.519] INFO: [SocketAuthority] Socket Connected to /socket.io YTXpc-ocZICitzW2AAAD
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.596] INFO: [Watcher] "Podcasts" Ready
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.742] INFO: [Watcher] "Books" Ready
Jul 22 12:37:30 bard audiobookshelf[407653]: [2025-07-22 12:37:30.848] INFO: [Watcher] "AudioBooks" Ready
Jul 22 12:37:36 bard audiobookshelf[407653]: [2025-07-22 12:37:36.806] INFO: [SocketAuthority] Socket wfdQ43uuHKTQfmW_AAAB disconnected from client "tebr
iel" after 7201ms (Reason: transport close)
Jul 22 12:37:37 bard audiobookshelf[407653]: [2025-07-22 12:37:37.639] INFO: [SocketAuthority] Socket Connected to /audiobookshelf/socket.io Ct7nnWs9KycF
UaZgAAAF
Jul 22 12:38:32 bard audiobookshelf[407653]: [2025-07-22 12:38:32.821] ERROR: [LocalAuth] Failed login attempt for username "tebriel-test" from ip fd7a:1
15c:a1e0::f201:fc07 (Invalid password)
Jul 22 12:38:43 bard audiobookshelf[407653]: [2025-07-22 12:38:43.464] INFO: [LocalAuth] User "tebriel-test" logged in from ip fd7a:115c:a1e0::f201:fc07
Jul 22 12:38:43 bard audiobookshelf[407653]: [2025-07-22 12:38:43.741] INFO: [SocketAuthority] Socket Connected to /audiobookshelf/socket.io IL6R6BeACI7F
zyMMAAAH
Jul 22 12:38:54 bard audiobookshelf[407653]: [2025-07-22 12:38:54.227] INFO: [SocketAuthority] Socket Connected to /socket.io ZjI95y1XB0E0lpRUAAAJ
Jul 22 12:38:55 bard audiobookshelf[407653]: [2025-07-22 12:38:55.508] INFO: [SocketAuthority] Socket ZjI95y1XB0E0lpRUAAAJ disconnected from client "tebr
iel" after 1281ms (Reason: transport close)
Jul 22 12:39:59 bard audiobookshelf[407653]: [2025-07-22 12:39:59.200] INFO: [LocalAuth] User "tebriel-test" logged in from ip 100.89.170.60
Jul 22 12:39:59 bard audiobookshelf[407653]: [2025-07-22 12:39:59.300] INFO: [SocketAuthority] Socket Connected to /socket.io IAbAI8PgUv2o-gMFAAAL
Jul 22 12:40:06 bard audiobookshelf[407653]: [2025-07-22 12:40:06.389] INFO: [SocketAuthority] Socket IAbAI8PgUv2o-gMFAAAL disconnected from client "tebriel-test" after 7089ms (Reason: transport close)
Jul 22 12:42:21 bard audiobookshelf[407653]: [2025-07-22 12:42:21.900] INFO: Received ping
```
</details>
more server logs, refreshed my tebriel-test user in BROWSER after restarting the server (undoing the expiry overrides) and tebriel-test was logged out, see the same error in the logs as the mobile app's error
There are a bunch of logs there that will eventually be visible on a logs page but for now I'm not sure how you could view them without building from source.
I just did a quick search and it looks like it is possible
@advplyr commented on GitHub (Jul 22, 2025):
Thanks for testing. Then I think the issue is with saving the refresh token in secure storage. https://github.com/advplyr/audiobookshelf-app/blob/master/ios/App/Shared/util/SecureStorage.swift
There are a bunch of logs there that will eventually be visible on a logs page but for now I'm not sure how you could view them without building from source.
I just did a quick search and it looks like it is possible
I ran into this issue today as well on the Android app.
Here is the relevant logs from the android app
07/22/2025 01:43:29.050 [INFO] handleTokenRefresh: Attempting to refresh auth tokens for server https://[SERVER_ADDRESS] (USERNAMEGOESHERE)
07/22/2025 01:43:29.055 [ERROR] handleTokenRefresh: Unable to refresh auth tokens. No refresh token available for server https://[SERVER_ADDRESS] (USERNAMEGOESHERE)
07/22/2025 01:43:29.057 [ERROR] sync: Local progress sync failed (count: 1) (title: "Mark of the Fool 3") (currentTime: 82033.794) (session id: 410b5980-8bb1-477c-85fe-b66b0486679b) (https://[SERVER_ADDRESS] (USERNAMEGOESHERE))
@hskrtich commented on GitHub (Jul 22, 2025):
I ran into this issue today as well on the Android app.
Here is the relevant logs from the android app
```
07/22/2025 01:43:29.050 [INFO] handleTokenRefresh: Attempting to refresh auth tokens for server https://[SERVER_ADDRESS] (USERNAMEGOESHERE)
07/22/2025 01:43:29.055 [ERROR] handleTokenRefresh: Unable to refresh auth tokens. No refresh token available for server https://[SERVER_ADDRESS] (USERNAMEGOESHERE)
07/22/2025 01:43:29.057 [ERROR] sync: Local progress sync failed (count: 1) (title: "Mark of the Fool 3") (currentTime: 82033.794) (session id: 410b5980-8bb1-477c-85fe-b66b0486679b) (https://[SERVER_ADDRESS] (USERNAMEGOESHERE))
```
@tebriel commented on GitHub (Jul 22, 2025):
@advplyr I started/stopped console logs using xcode, idk if any of this is useful: https://gist.github.com/tebriel/a749610c05b85de35ccb981d58845d64. If you have a guide/guidance on what else I could pull from here lmk.
Same issues with me with Authelia sso. I've had this happen a few times now after 2.26.
I have to manually delete and recreate the creds to get in.
@Lord0fBytes commented on GitHub (Jul 23, 2025):
Same issues with me with Authelia sso. I've had this happen a few times now after 2.26.
I have to manually delete and recreate the creds to get in.
Still not sure what is going on here. For anyone that has this issue if you can share the server version you're on, whether you are android/iOS and if you are logging in with open id or with password.
May help to establish a pattern but I think I'll have to set up the logger if I can't reproduce it.
@advplyr commented on GitHub (Jul 24, 2025):
Still not sure what is going on here. For anyone that has this issue if you can share the server version you're on, whether you are android/iOS and if you are logging in with open id or with password.
May help to establish a pattern but I think I'll have to set up the logger if I can't reproduce it.
server version: v2.26.0 & v2.26.2 - first I did when encountering the issue was to upgrade server
Phone platform: Android 15
Login: OIDC via Authentik
@TheTerrasque commented on GitHub (Jul 24, 2025):
server version: v2.26.0 & v2.26.2 - first I did when encountering the issue was to upgrade server
Phone platform: Android 15
Login: OIDC via Authentik
The vast majority of Abs users aren't using OIDC and it seems most of the users mentioning this issue are using OIDC so that may be a pattern
@advplyr commented on GitHub (Jul 24, 2025):
The vast majority of Abs users aren't using OIDC and it seems most of the users mentioning this issue are using OIDC so that may be a pattern
I have disabled all other auths. I don't use advanced perissions claims.
@yourfate commented on GitHub (Jul 25, 2025):
Just for reference, here are my auth settings:
<img width="871" height="1213" alt="Image" src="https://github.com/user-attachments/assets/8fbe887a-065c-423d-a52c-073107cbd470" />
I have disabled all other auths. I don't use advanced perissions claims.
Im on server 2.26.0
I use Authelia for OIDC.
It was just after the latest iOS release I had the issue. I dont think it's related to the server version. I can log into the web browser without issues with OIDC.
Since I have to delete and re-create the server each time to login it sounds like the refresh token that gets stored on the phone is not 'saving' (not super technical). It signs in perfectly fine if I delete the server and re-add it.
@Lord0fBytes commented on GitHub (Jul 26, 2025):
Im on server `2.26.0`
I use Authelia for OIDC.
It was just after the latest iOS release I had the issue. I dont think it's related to the server version. I can log into the web browser without issues with OIDC.
Since I have to delete and re-create the server each time to login it sounds like the refresh token that gets stored on the phone is not 'saving' (not super technical). It signs in perfectly fine if I delete the server and re-add it.
Yes I very much suspect this is an iOS app problem. Other iOS apps, such as plappa, stay logged in without problem.
@yourfate commented on GitHub (Jul 26, 2025):
Yes I very much suspect this is an iOS app problem. Other iOS apps, such as plappa, stay logged in without problem.
I'm having the same issue but on Android.
Platform:Android
App: 0.10.0-beta
Server: 2.26.3
OIDC: Authelia
I can connect fine on fresh server add. However after the token expires if I try and connect to the server I get
[Auth] Failed to refresh token. No refresh token provided" error.```
@edster commented on GitHub (Jul 27, 2025):
I'm having the same issue but on Android.
Platform:Android
App: 0.10.0-beta
Server: 2.26.3
OIDC: Authelia
I can connect fine on fresh server add. However after the token expires if I try and connect to the server I get
```ERROR
[Auth] Failed to refresh token. No refresh token provided" error.```
Ill add my voice to this problem, times out after token rotation, and have to sign in.
Auth:
OIDC (authentik)
IOS app
Version: v2.26.3
@jacoknapp commented on GitHub (Jul 28, 2025):
Ill add my voice to this problem, times out after token rotation, and have to sign in.
Auth:
OIDC (authentik)
IOS app
Version: v2.26.3
I'm having the same issue but on Android. Platform:Android App: 0.10.0-beta Server: 2.26.3 OIDC: Authelia
I can connect fine on fresh server add. However after the token expires if I try and connect to the server I get
[Auth] Failed to refresh token. No refresh token provided" error.```
Update on this, got the error from the app. 07/27/2025 09:20:23.210 [ERROR] handleTokenRefresh: Failed to parse refresh response for server https://[SERVER_ADDRESS] (myUser) (error: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject)
@edster commented on GitHub (Jul 29, 2025):
> I'm having the same issue but on Android. Platform:Android App: 0.10.0-beta Server: 2.26.3 OIDC: Authelia
>
> I can connect fine on fresh server add. However after the token expires if I try and connect to the server I get
>
> ```
>
> [Auth] Failed to refresh token. No refresh token provided" error.```
> ```
Update on this, got the error from the app.
`07/27/2025 09:20:23.210 [ERROR] handleTokenRefresh: Failed to parse refresh response for server https://[SERVER_ADDRESS] (myUser) (error: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject)`
This looks to be the file that was changed up that handles the refresh tokens. I cannot quite decyper what is going on, but this looks like it lines up with the timing and verbiage.
@Lord0fBytes commented on GitHub (Jul 29, 2025):
Looking through the recent commits. It looks like it might have something to do with this: https://github.com/advplyr/audiobookshelf-app/commit/239a943172a3a5e019c3a31189d1353d4db6ae8a#diff-a27a18215451cb2addd7fb4538ffd58a28a505d647bd121a8f70d8c12e26d62aR630
This looks to be the file that was changed up that handles the refresh tokens. I cannot quite decyper what is going on, but this looks like it lines up with the timing and verbiage.
@tebriel commented on GitHub (Jul 30, 2025):
> Yes I very much suspect this is an iOS app problem. Other iOS apps, such as plappa, stay logged in without problem.
@yourfate I don't think plappa has been updated with the new login scheme yet and is still using the old method. Details in https://github.com/advplyr/audiobookshelf/discussions/4460
@therealadamstel commented on GitHub (Aug 7, 2025):
Can you try configuring a separate user that uses password authentication so we can check if the issue is related to the OIDC endpoint not returning a refresh token?
The iOS app doesn't have the logger that the Android app has yet so it will be hard to debug without seeing the logs on whether the refresh token was saved to secure storage.
Can also confirm this happens on the Android app as well. I'm on the latest server version (2.27.0), and the latest android app version (v0.10.0-beta). My OIDC is just Google because I'm too lazy to set up something. I'm not sure if this is related or not, but I'm usually fiendishly listening to audiobooks, but the past week I've been 1-2 days between sessions. I would normally always be within the 12 hour access token validity window prior to this week, and the problem has started for me in the past few days.
For reference, I switched to OIDC June 26. My app didn't require me to re-login, but it finally did on July 21. I had to delete the server and re-add it. I've been using that login session consistently until I noticed the app wasn't syncing on Aug 5, or day 15 after my login session.
I set up a password-based user. I see no errors in the logs.
I set up a new OIDC user as well. I'll switch off them in the app to let my tokens expire and see if there is anything useful in the logs after it expires.
That said, is there a switch in app I'm missing that changes the log collection to DEBUG instead of INFO?
@therealadamstel commented on GitHub (Aug 7, 2025):
> Can you try configuring a separate user that uses password authentication so we can check if the issue is related to the OIDC endpoint not returning a refresh token?
>
> The iOS app doesn't have the logger that the Android app has yet so it will be hard to debug without seeing the logs on whether the refresh token was saved to secure storage.
Can also confirm this happens on the Android app as well. I'm on the latest server version (2.27.0), and the latest android app version (v0.10.0-beta). My OIDC is just Google because I'm too lazy to set up something. I'm not sure if this is related or not, but I'm usually fiendishly listening to audiobooks, but the past week I've been 1-2 days between sessions. I would normally always be within the 12 hour access token validity window prior to this week, and the problem has started for me in the past few days.
For reference, I switched to OIDC June 26. My app didn't require me to re-login, but it finally did on July 21. I had to delete the server and re-add it. I've been using that login session consistently until I noticed the app wasn't syncing on Aug 5, or day 15 after my login session.
I set up a password-based user. I see no errors in the logs.
I set up a new OIDC user as well. I'll switch off them in the app to let my tokens expire and see if there is anything useful in the logs after it expires.
That said, is there a switch in app I'm missing that changes the log collection to DEBUG instead of INFO?
That said, is there a switch in app I'm missing that changes the log collection to DEBUG instead of INFO?
Not currently, logging in the app is still very minimal. There are a lot of logs using ADB, but they have not all been switched over yet.
@nichwall commented on GitHub (Aug 7, 2025):
> That said, is there a switch in app I'm missing that changes the log collection to DEBUG instead of INFO?
Not currently, logging in the app is still very minimal. There are a lot of logs using ADB, but they have not all been switched over yet.
I've logged in to the app via SSO but when I encounter this error I don't get the SSO button to re-login so I re-login via username/password. The error still occurs when I re-login with username/password. I haven't tried clearing the config and logging in from scratch without SSO (i.e. via username/password only), but doing so might help narrow down if it's a server issue or an app issue.
I set the access token to 60s and conducted some tests.
Closing the app and re-opening after 60s takes me to a screen where I can choose the server to login to. The output from logcat is rather interesting. Does it even attempt to use the refresh token to obtain a new access token?
08-13 10:32:24.140 15418 18335 I AbsLogger: mounted: initializing first load (android v0.10.0-beta)
08-13 10:32:24.213 15418 18335 I AbsLogger: mounted: Server not connected, attempt connection
08-13 10:32:24.218 15418 18335 I AbsLogger: attemptConnection: Got server config, attempt authorize (https://<snip>)
08-13 10:32:24.325 15418 18335 I AbsLogger: Logged out from server Not connected
08-13 10:32:24.329 15418 18335 D SecureStorage: Successfully removed refresh token for server: aHR0cHM6LyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxkYQ==
08-13 10:32:24.335 15418 18335 E AbsLogger: attemptConnection: Server auth failed (https://<snip>)
08-13 10:32:24.339 15418 18335 I AbsLogger: mounted: fully initialized
Clearing out the config and logging in via Authelia appears to work, stores the refresh token, etc.
08-13 10:39:47.748 15418 18335 D AbsDatabase: setCurrentServerConnectionConfig {"address":"https:\/\/audiobookshelf.yodadacoda.info","userId":"da96e076-xxxx-xxxx-xxxx-efc27ea7c946","username":"YodaDaCoda","version":"2.28.0","token":"<snip>","refreshToken":"<snip>"}
08-13 10:39:47.772 15418 15699 D SecureStorage: Successfully stored encrypted refresh token for server: aHR0cHM6LyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxkYQ==
08-13 10:39:47.772 15418 15699 D AbsDatabase: Refresh token secured = true
08-13 10:39:47.892 15418 18335 I AbsLogger: mounted: initializing first load (android v0.10.0-beta)
08-13 10:39:47.910 15418 18335 I AbsLogger: mounted: Server connected, init libraries (https://<snip>)
08-13 10:39:48.003 15418 18335 I AbsLogger: initLibraries loading library Audiobooks
This cycle repeats when I close & re-open the app after 60s.
This is where the attemptConnection: Server auth failed message is coming from - shouldn't it attempt to refresh the token here?
@YodaDaCoda commented on GitHub (Aug 13, 2025):
Server version: `v2.28.0`
App version: `0.10.0-beta`
Phone OS: Android 13
Login via: Authelia SSO / Password
I've logged in to the app via SSO but when I encounter this error I don't get the SSO button to re-login so I re-login via username/password. The error still occurs when I re-login with username/password. I haven't tried clearing the config and logging in from scratch without SSO (i.e. via username/password only), but doing so might help narrow down if it's a server issue or an app issue.
I set the access token to 60s and conducted some tests.
Closing the app and re-opening after 60s takes me to a screen where I can choose the server to login to. The output from logcat is rather interesting. Does it even attempt to use the refresh token to obtain a new access token?
<details>
```
08-13 10:32:24.140 15418 18335 I AbsLogger: mounted: initializing first load (android v0.10.0-beta)
08-13 10:32:24.213 15418 18335 I AbsLogger: mounted: Server not connected, attempt connection
08-13 10:32:24.218 15418 18335 I AbsLogger: attemptConnection: Got server config, attempt authorize (https://<snip>)
08-13 10:32:24.325 15418 18335 I AbsLogger: Logged out from server Not connected
08-13 10:32:24.329 15418 18335 D SecureStorage: Successfully removed refresh token for server: aHR0cHM6LyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxkYQ==
08-13 10:32:24.335 15418 18335 E AbsLogger: attemptConnection: Server auth failed (https://<snip>)
08-13 10:32:24.339 15418 18335 I AbsLogger: mounted: fully initialized
```
</details>
Clearing out the config and logging in via Authelia appears to work, stores the refresh token, etc.
<details>
```
08-13 10:39:47.748 15418 18335 D AbsDatabase: setCurrentServerConnectionConfig {"address":"https:\/\/audiobookshelf.yodadacoda.info","userId":"da96e076-xxxx-xxxx-xxxx-efc27ea7c946","username":"YodaDaCoda","version":"2.28.0","token":"<snip>","refreshToken":"<snip>"}
08-13 10:39:47.772 15418 15699 D SecureStorage: Successfully stored encrypted refresh token for server: aHR0cHM6LyxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxkYQ==
08-13 10:39:47.772 15418 15699 D AbsDatabase: Refresh token secured = true
08-13 10:39:47.892 15418 18335 I AbsLogger: mounted: initializing first load (android v0.10.0-beta)
08-13 10:39:47.910 15418 18335 I AbsLogger: mounted: Server connected, init libraries (https://<snip>)
08-13 10:39:48.003 15418 18335 I AbsLogger: initLibraries loading library Audiobooks
```
</details>
This cycle repeats when I close & re-open the app after 60s.
This is where the `attemptConnection: Server auth failed` message is coming from - shouldn't it attempt to refresh the token here?
https://github.com/advplyr/audiobookshelf-app/blob/bd8668f0bfc01b22ebed3638494bb03936582b33/layouts/default.vue#L140-L143
Using pocket-id with oidc. Seems if the server is restarted requires reauth but I can only login with my oidc provider by removing the server listed and adding it again.
Quick fix might be to add the oidc login button to the existing server login.
@eximo84 commented on GitHub (Aug 13, 2025):
Can confirm I am seeing this also
iOS app version: 0.10.0-beta
ABS Server: 2.27.0
Using pocket-id with oidc. Seems if the server is restarted requires reauth but I can only login with my oidc provider by removing the server listed and adding it again.
Quick fix might be to add the oidc login button to the existing server login.
Using pocket-id with oidc. Seems if the server is restarted requires reauth but I can only login with my oidc provider by removing the server listed and adding it again.
Quick fix might be to add the oidc login button to the existing server login.
@jtbrush56 commented on GitHub (Aug 14, 2025):
> Can confirm I am seeing this also
>
> iOS app version: 0.10.0-beta ABS Server: 2.27.0
>
> Using pocket-id with oidc. Seems if the server is restarted requires reauth but I can only login with my oidc provider by removing the server listed and adding it again.
>
> Quick fix might be to add the oidc login button to the existing server login.
@advplyr here is a quick PR that adds the oidc login button when we need to relogin https://github.com/advplyr/audiobookshelf-app/pull/1660
@zacharyburnett commented on GitHub (Sep 2, 2025):
In any case, I'm sure @advplyr will get to it when they get to it so it doesn't make much sense to bug them about the new release. In the meantime I can use the webapp on my phone and stream audio
@zacharyburnett commented on GitHub (Sep 2, 2025):
In any case, I'm sure @advplyr will get to it when they get to it so it doesn't make much sense to bug them about the new release. In the meantime I can use the webapp on my phone and stream audio
@github-actions[bot] commented on GitHub (Sep 4, 2025):
Fixed in [v0.10.1-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.10.1-beta).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @tebriel on GitHub (Jul 22, 2025).
I have verified that the bug is not already awaiting release
Yes
What was the Problem?
When I open up the app after a few hours of inactivity (say before bed the night before and then in the morning) the app is logged out and shows me the log-in screen with my URL, username pre-filled, and blank password box. There is an error saying "no refresh token available".
The "Login with Authentik" box is not visible, the only workaround is to click the trashcan to delete the stored credentials, enter the URL again and log in again.
Steps to Reproduce the Issue
What was Expected?
My login session would continue like it did before the auth refactor.
Additionally if there's an error with my session/credentials, present me with the "login with authentik" button again, that button should always be present.
Phone Model
iPhone 15 Pro
Phone OS
18.5
Audiobookshelf App Version
iOS App - 0.10.0
Installation Source
Testflight
Additional Notes
ABS Server: 2.26.2
Authentik: 2025.6.3
@advplyr commented on GitHub (Jul 22, 2025):
Can you try configuring a separate user that uses password authentication so we can check if the issue is related to the OIDC endpoint not returning a refresh token?
The iOS app doesn't have the logger that the Android app has yet so it will be hard to debug without seeing the logs on whether the refresh token was saved to secure storage.
@advplyr commented on GitHub (Jul 22, 2025):
The access token expiration is default to 12h but can be overridden by an env variable
ACCESS_TOKEN_EXPIRY: Access token expiration in seconds (initial default: 43200 = 12 hours)REFRESH_TOKEN_EXPIRY: Refresh token expiration in seconds (initial default: 604800 = 7 days)@tebriel commented on GitHub (Jul 22, 2025):
@advplyr
Test:
ACCESS_TOKEN_EXPIRY = 60REFRESH_TOKEN_EXPIRY = 300Code change documentation in case I need it again
non-authentik
@tebriel commented on GitHub (Jul 22, 2025):
server logs, I had a browser window with the logged in user open so this is two sessions. Failed login attempt was me mistyping the password (whoops). So nothing of note on the server side (expected but always helps to check).
server logs
@tebriel commented on GitHub (Jul 22, 2025):
more server logs, refreshed my
tebriel-testuser in BROWSER after restarting the server (undoing the expiry overrides) and tebriel-test was logged out, see the same error in the logs as the mobile app's errorSystem logs after restart
@advplyr commented on GitHub (Jul 22, 2025):
Thanks for testing. Then I think the issue is with saving the refresh token in secure storage. https://github.com/advplyr/audiobookshelf-app/blob/master/ios/App/Shared/util/SecureStorage.swift
There are a bunch of logs there that will eventually be visible on a logs page but for now I'm not sure how you could view them without building from source.
I just did a quick search and it looks like it is possible
@hskrtich commented on GitHub (Jul 22, 2025):
I ran into this issue today as well on the Android app.
Here is the relevant logs from the android app
@tebriel commented on GitHub (Jul 22, 2025):
@advplyr I started/stopped console logs using xcode, idk if any of this is useful: https://gist.github.com/tebriel/a749610c05b85de35ccb981d58845d64. If you have a guide/guidance on what else I could pull from here lmk.
@Lord0fBytes commented on GitHub (Jul 23, 2025):
Same issues with me with Authelia sso. I've had this happen a few times now after 2.26.
I have to manually delete and recreate the creds to get in.
@advplyr commented on GitHub (Jul 24, 2025):
Still not sure what is going on here. For anyone that has this issue if you can share the server version you're on, whether you are android/iOS and if you are logging in with open id or with password.
May help to establish a pattern but I think I'll have to set up the logger if I can't reproduce it.
@yourfate commented on GitHub (Jul 24, 2025):
Happens to all 3 users of my instance, v2.26.2, iOS app 10.0.
I use pocket ID for authentication.
@TheTerrasque commented on GitHub (Jul 24, 2025):
server version: v2.26.0 & v2.26.2 - first I did when encountering the issue was to upgrade server
Phone platform: Android 15
Login: OIDC via Authentik
@advplyr commented on GitHub (Jul 24, 2025):
The vast majority of Abs users aren't using OIDC and it seems most of the users mentioning this issue are using OIDC so that may be a pattern
@yourfate commented on GitHub (Jul 25, 2025):
Just for reference, here are my auth settings:
I have disabled all other auths. I don't use advanced perissions claims.
@Lord0fBytes commented on GitHub (Jul 26, 2025):
Im on server
2.26.0I use Authelia for OIDC.
It was just after the latest iOS release I had the issue. I dont think it's related to the server version. I can log into the web browser without issues with OIDC.
Since I have to delete and re-create the server each time to login it sounds like the refresh token that gets stored on the phone is not 'saving' (not super technical). It signs in perfectly fine if I delete the server and re-add it.
@yourfate commented on GitHub (Jul 26, 2025):
Yes I very much suspect this is an iOS app problem. Other iOS apps, such as plappa, stay logged in without problem.
@edster commented on GitHub (Jul 27, 2025):
I'm having the same issue but on Android.
Platform:Android
App: 0.10.0-beta
Server: 2.26.3
OIDC: Authelia
I can connect fine on fresh server add. However after the token expires if I try and connect to the server I get
@jacoknapp commented on GitHub (Jul 28, 2025):
Ill add my voice to this problem, times out after token rotation, and have to sign in.
Auth:
OIDC (authentik)
IOS app
Version: v2.26.3
@edster commented on GitHub (Jul 29, 2025):
Update on this, got the error from the app.
07/27/2025 09:20:23.210 [ERROR] handleTokenRefresh: Failed to parse refresh response for server https://[SERVER_ADDRESS] (myUser) (error: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject)@Lord0fBytes commented on GitHub (Jul 29, 2025):
Looking through the recent commits. It looks like it might have something to do with this: https://github.com/advplyr/audiobookshelf-app/commit/239a943172a3a5e019c3a31189d1353d4db6ae8a#diff-a27a18215451cb2addd7fb4538ffd58a28a505d647bd121a8f70d8c12e26d62aR630
This looks to be the file that was changed up that handles the refresh tokens. I cannot quite decyper what is going on, but this looks like it lines up with the timing and verbiage.
@tebriel commented on GitHub (Jul 30, 2025):
@yourfate I don't think plappa has been updated with the new login scheme yet and is still using the old method. Details in https://github.com/advplyr/audiobookshelf/discussions/4460
@zacharyburnett commented on GitHub (Aug 6, 2025):
Can confirm this occurs with authelia on ABS v2.27.0 as well
@therealadamstel commented on GitHub (Aug 7, 2025):
Can also confirm this happens on the Android app as well. I'm on the latest server version (2.27.0), and the latest android app version (v0.10.0-beta). My OIDC is just Google because I'm too lazy to set up something. I'm not sure if this is related or not, but I'm usually fiendishly listening to audiobooks, but the past week I've been 1-2 days between sessions. I would normally always be within the 12 hour access token validity window prior to this week, and the problem has started for me in the past few days.
For reference, I switched to OIDC June 26. My app didn't require me to re-login, but it finally did on July 21. I had to delete the server and re-add it. I've been using that login session consistently until I noticed the app wasn't syncing on Aug 5, or day 15 after my login session.
I set up a password-based user. I see no errors in the logs.
I set up a new OIDC user as well. I'll switch off them in the app to let my tokens expire and see if there is anything useful in the logs after it expires.
That said, is there a switch in app I'm missing that changes the log collection to DEBUG instead of INFO?
@nichwall commented on GitHub (Aug 7, 2025):
Not currently, logging in the app is still very minimal. There are a lot of logs using ADB, but they have not all been switched over yet.
@YodaDaCoda commented on GitHub (Aug 13, 2025):
Server version:
v2.28.0App version:
0.10.0-betaPhone OS: Android 13
Login via: Authelia SSO / Password
I've logged in to the app via SSO but when I encounter this error I don't get the SSO button to re-login so I re-login via username/password. The error still occurs when I re-login with username/password. I haven't tried clearing the config and logging in from scratch without SSO (i.e. via username/password only), but doing so might help narrow down if it's a server issue or an app issue.
I set the access token to 60s and conducted some tests.
Closing the app and re-opening after 60s takes me to a screen where I can choose the server to login to. The output from logcat is rather interesting. Does it even attempt to use the refresh token to obtain a new access token?
Clearing out the config and logging in via Authelia appears to work, stores the refresh token, etc.
This cycle repeats when I close & re-open the app after 60s.
This is where the
attemptConnection: Server auth failedmessage is coming from - shouldn't it attempt to refresh the token here?https://github.com/advplyr/audiobookshelf-app/blob/bd8668f0bfc01b22ebed3638494bb03936582b33/layouts/default.vue#L140-L143
@eximo84 commented on GitHub (Aug 13, 2025):
Can confirm I am seeing this also
iOS app version: 0.10.0-beta
ABS Server: 2.27.0
Using pocket-id with oidc. Seems if the server is restarted requires reauth but I can only login with my oidc provider by removing the server listed and adding it again.
Quick fix might be to add the oidc login button to the existing server login.
@jtbrush56 commented on GitHub (Aug 14, 2025):
@advplyr here is a quick PR that adds the oidc login button when we need to relogin https://github.com/advplyr/audiobookshelf-app/pull/1660
@Lord0fBytes commented on GitHub (Aug 27, 2025):
Any update on when the release will be released?
@GinSoakedBoy commented on GitHub (Sep 2, 2025):
I'd also be curious to know if there is an ETA on the next app update to fix this.
@vonProteus commented on GitHub (Sep 2, 2025):
Beta expires in 46 days
So my guess is before 2025-10-18
Probably not very helpful ^_^
@zacharyburnett commented on GitHub (Sep 2, 2025):
In any case, I'm sure @advplyr will get to it when they get to it so it doesn't make much sense to bug them about the new release. In the meantime I can use the webapp on my phone and stream audio
@github-actions[bot] commented on GitHub (Sep 4, 2025):
Fixed in v0.10.1-beta.