Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Twitch rest client factory for multiple authorization #8

Open
Aux opened this issue Feb 5, 2023 · 0 comments
Open

[Feature] Twitch rest client factory for multiple authorization #8

Aux opened this issue Feb 5, 2023 · 0 comments
Assignees
Labels
area-Rest Specific to the Rest project enhancement New feature or request

Comments

@Aux
Copy link
Contributor

Aux commented Feb 5, 2023

There are many situations with the twitch api where requests can only be made using an oauth token authorized by a broadcaster or moderator rather than an application's user account. The best method to handle this is probably by making a TwitchRestApiClientFactory or something similar that manages identity internally and allows the user to generate TwitchRestApiClient for authorized users as needed.

Notes

  • Ironically , the identity api client itself doesn't have a sense of identity, so it can be inside the factory itself.
  • TwitchRestApiClient would need a constructor to allow providing a premade HttpClient.
  • The factory class would need to cache validated identities and provide methods for getting user identities by id or name.

While this method works fine for the lower library, it will probably cause issues with the higher library. Since entities there all contain a reference to the client that created them it might cause confusion if a user caches them, but it might not we'll see.

@Aux Aux added enhancement New feature or request area-Rest Specific to the Rest project labels Feb 5, 2023
@Aux Aux self-assigned this Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Rest Specific to the Rest project enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant