clearAuthTokens

Clears cached tokens/credentials from all auth providers that support token clearing.

This is a convenience method that calls clearToken on all applicable auth providers:

Use this method when:

  • User logs out and tokens should be invalidated

  • Credentials have been updated externally

  • You want to force fresh token/credential loading

Note: This only affects providers where caching is enabled (default behavior). If io.ktor.client.plugins.auth.providers.BearerAuthConfig.cacheTokens or io.ktor.client.plugins.auth.providers.BasicAuthConfig.cacheTokens is set to false, this method has no effect on those providers.

Example:

// Clear all cached auth tokens on logout
client.clearAuthTokens()

Report a problem