New JWT authentication #4460
Replies: 6 comments 31 replies
-
JWT Auth EndpointsPOST
|
Beta Was this translation helpful? Give feedback.
-
need advisory on swag / nginx / fail2ban filter in front. Since the update fail2ban pretty regularly kills me and the web client. as there are way more 401s. Possible solutions:
what is your point on that? |
Beta Was this translation helpful? Give feedback.
-
i'm working on 3rd party android app for audiobookshelf, just to clarify regarding this new JWT token implementation. |
Beta Was this translation helpful? Give feedback.
-
Could you please explain what the correct way if access and refresh tokens are both expired? Shall I redirect the user on Login page? |
Beta Was this translation helpful? Give feedback.
-
For those of us using OIDC for authentication where our IDP is already providing authentication, how does the introduction of JWT based authentication impact us? |
Beta Was this translation helpful? Give feedback.
-
I have been using Pocket-ID to authenticate to abs - both web and iOS app. Today the iOS app stopped working. I can still log in normally on web, including from my phone. But the iOS app says the server is not connected, and when I hit the Connect button and hit the server name, it says "Failed to authorize (No refresh token available)". Running 2.27.0 server and 0.10.0 app |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
Audiobookshelf has replaced its token-based authentication system with JWT (JSON Web Token) authentication using refresh tokens. The new system includes database-backed session management and a separate auth method using configurable API keys.
The initial rollout (v2.26.0) includes no breaking changes to allow for the mobile apps to migrate and any 3rd party apps to migrate.
Key Changes
JWT Authentication System
API Key System
Security Enhancements
Migration Notes
v2.26.0
and contains no breaking changesv2.26.0
Users will be required to re-authenticate on first useAuthentication Flows
JWT Authentication Flow
JWT User Login
/login
endpointJWT Refresh Process
/auth/refresh
endpointJWT Logout Process
/logout
endpointSee API endpoints
API Key Authentication Flow
API Key Creation
/api/api-keys
endpoint (or web client)apiKeys
tableAPI Key Usage
Bearer <api_key>
API Key Management
Configuration
Environment Variables
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)RATE_LIMIT_AUTH_WINDOW
: Rate limiting window in milliseconds (default: 600000 = 10 minutes)RATE_LIMIT_AUTH_MAX
: Maximum auth attempts per window (default: 40) (use 0 to disable rate limiter)Warning: Do not change the secret on an existing server until the next mobile app release or until the 3rd party app you are using has migrated. This will make the old tokens unusable so that only migrated apps can authenticate with your server.
JWT_SECRET_KEY
: Custom JWT signing secret (auto-generated if not provided)Beta Was this translation helpful? Give feedback.
All reactions