@@ -272,7 +272,7 @@ mcp-oauth:
272272
273273**Key Points:**
274274- **No credentials needed** - DCR automatically registers the client on first start
275- - **Credentials persist** - Saved to ` .nextcloud_oauth_client.json` and reused
275+ - **Credentials persist** - Saved to SQLite database and reused
276276- **JWT tokens** - Use ` --oauth-token-type jwt` for better performance
277277- **Token verifier supports both** - Can handle JWT and opaque tokens
278278- **Pre-configured credentials** - Providing `CLIENT_ID`/`CLIENT_SECRET` skips DCR
@@ -286,7 +286,6 @@ mcp-oauth:
286286| `NEXTCLOUD_PUBLIC_ISSUER_URL` | Public issuer URL for JWT validation | (uses `NEXTCLOUD_HOST`) |
287287| `NEXTCLOUD_OIDC_CLIENT_ID` | Pre-configured OAuth client ID | (optional - uses DCR if unset) |
288288| `NEXTCLOUD_OIDC_CLIENT_SECRET` | Pre-configured OAuth client secret | (optional - uses DCR if unset) |
289- | `NEXTCLOUD_OIDC_CLIENT_STORAGE` | Path to persist DCR-registered credentials | `.nextcloud_oauth_client.json` |
290289| `NEXTCLOUD_OIDC_SCOPES` | Space-separated scopes to request | `"openid profile email mcp:notes:read mcp:notes:write"` |
291290| `NEXTCLOUD_OIDC_TOKEN_TYPE` | Token format : ` "jwt"` or `"Bearer"` | `"Bearer"` |
292291
@@ -303,8 +302,8 @@ When the MCP server starts in OAuth mode, it follows this **three-tier credentia
303302 ├─ NEXTCLOUD_OIDC_CLIENT_ID
304303 └─ NEXTCLOUD_OIDC_CLIENT_SECRET
305304
306- 2. Storage File (Second Priority)
307- └─ NEXTCLOUD_OIDC_CLIENT_STORAGE (.nextcloud_oauth_client.json)
305+ 2. SQLite Database (Second Priority)
306+ └─ OAuth client credentials table
308307
3093083. Dynamic Client Registration (Automatic Fallback)
310309 ├─ Discovers registration endpoint from /.well-known/openid-configuration
@@ -327,10 +326,10 @@ export NEXTCLOUD_OIDC_TOKEN_TYPE=jwt # or "Bearer" for opaque tokens
327326
328327**Credential Storage:**
329328
330- - Registered credentials are saved to `NEXTCLOUD_OIDC_CLIENT_STORAGE` (default : ` .nextcloud_oauth_client.json ` )
331- - File has restrictive permissions (0600 - owner read/write only)
329+ - Registered credentials are saved to SQLite database
330+ - Database is encrypted and protected by file system permissions
332331- Credentials are reused on subsequent starts (no re-registration needed)
333- - Storage file is checked for expiration (auto-regenerates if expired)
332+ - Stored credentials are checked for expiration (auto-regenerates if expired)
334333
335334**Format:**
336335` ` ` json
@@ -386,9 +385,9 @@ export NEXTCLOUD_OIDC_CLIENT_ID="<client_id>"
386385export NEXTCLOUD_OIDC_CLIENT_SECRET="<client_secret>"
387386export NEXTCLOUD_OIDC_TOKEN_TYPE="jwt"
388387
389- # Option 2: Storage file (second priority)
390- # Save the JSON response to .nextcloud_oauth_client.json
391- # Server will automatically load it on startup
388+ # Option 2: SQLite database (second priority)
389+ # Credentials are automatically saved to the database after DCR
390+ # Server will automatically load them on startup
392391` ` `
393392
394393When credentials are provided via environment variables or storage file, **DCR is skipped**.
@@ -724,7 +723,7 @@ docker compose exec db mariadb -u nextcloud -ppassword nextcloud \
7247231 . Ensure ` NEXTCLOUD_OIDC_SCOPES ` environment variable is set correctly
7257242 . Check MCP server startup logs for the scopes being requested
7267253 . Verify DCR is enabled in Nextcloud OIDC app settings
727- 4 . Delete ` .nextcloud_oauth_client.json ` and restart to force re-registration
726+ 4 . Clear the SQLite database OAuth client entry and restart to force re-registration
728727
729728### Issue: Token Type Case Sensitivity
730729
0 commit comments