Skip to content

refactor: remove deprecated OAuth authentication base classes#9337

Open
Romazes wants to merge 1 commit intoQuantConnect:masterfrom
Romazes:remove-deprecated-oauth-classes
Open

refactor: remove deprecated OAuth authentication base classes#9337
Romazes wants to merge 1 commit intoQuantConnect:masterfrom
Romazes:remove-deprecated-oauth-classes

Conversation

@Romazes
Copy link
Collaborator

@Romazes Romazes commented Mar 16, 2026

Description

Remove deprecated OAuth authentication base classes superseded by the concrete
implementations introduced in #9330. Cleans up Brokerages/Authentication/ by deleting:

  • OAuthTokenHandler.cs — generic OAuthTokenHandler<TRequest, TResponse>, replaced by LeanOAuthTokenHandler
  • TokenHandler.cs — abstract TokenHandler<T>, replaced by LeanTokenHandler
  • TokenCredentials.cs — replaced by LeanTokenCredentials
  • AccessTokenMetaDataRequest.cs — abstract base, replaced by OAuthTokenRequest
  • AccessTokenMetaDataResponse.cs — abstract base no longer needed; expiry tracking moved into the handler

Also updates XML documentation in LeanOAuthTokenHandler.cs and LeanTokenHandler.cs
to reference the new concrete types.

Related PRs

All new OAuth logic was implemented in PRs:

Related Issue

Follows up on #9330feat: add CreateOAuthTokenHandler factory to Brokerage base class

Motivation and Context

PR #9330 introduced the new concrete, non-generic authentication handlers as part of the
OAuth authentication failure shutdown feature. The old abstract/generic base classes
(OAuthTokenHandler<TRequest, TResponse>, TokenHandler<T>, etc.) became dead code
and are removed here to keep the codebase clean.

Requires Documentation Change

No. The removed classes were internal infrastructure not referenced in public documentation.

How Has This Been Tested?

Verified the solution builds successfully after deletion. All callers of the deleted
classes were already migrated to the new concrete types in #9330.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

Remove abstract/generic auth infrastructure superseded by the concrete
implementations introduced in QuantConnect#9330 (LeanOAuthTokenHandler, LeanTokenHandler,
LeanTokenCredentials):

- Delete OAuthTokenHandler<TRequest, TResponse>
- Delete abstract TokenHandler<T> base
- Delete TokenCredentials (replaced by LeanTokenCredentials)
- Delete abstract AccessTokenMetaDataRequest/Response base classes
- Update XML documentation in LeanOAuthTokenHandler and LeanTokenHandler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Romazes Romazes requested a review from Martin-Molinero March 16, 2026 14:22
@Romazes Romazes self-assigned this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant