You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -226,6 +228,26 @@ In v4, `clearCredentials()` calls `Storage.removeAll()`, which clears **all** va
226
228
227
229
**Impact:** Existing custom `Storage` implementations will continue to compile and work without changes. Override `removeAll()` to provide the actual clearing behavior if your custom storage is used with `clearCredentials()`.
228
230
231
+
## New APIs
232
+
233
+
### `clearAll()` — Full Credential and Key Cleanup
234
+
235
+
v4 introduces a new `clearAll()` method on `CredentialsManager` and `SecureCredentialsManager` that performs a complete cleanup of all stored credentials **and** cryptographic key pairs.
236
+
237
+
**Usage:**
238
+
239
+
```kotlin
240
+
// Clear everything on logout — credentials, DPoP keys, and encryption keys
241
+
credentialsManager.clearAll()
242
+
```
243
+
244
+
**When to use `clearAll()` vs `clearCredentials()`:**
245
+
246
+
- Use **`clearCredentials()`** when you only need to remove stored tokens (e.g., forcing a re-login) but want to preserve cryptographic keys for future sessions.
247
+
- Use **`clearAll()`** on full logout or account removal, when you want to ensure no credentials or key material remain on the device.
248
+
249
+
> **Note:**`clearAll()` catches any errors from DPoP key pair deletion internally, so it will not throw even if the DPoP key pair was never created or has already been removed.
0 commit comments