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
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.
The text was updated successfully, but these errors were encountered:
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 generateTwitchRestApiClient
for authorized users as needed.Notes
TwitchRestApiClient
would need a constructor to allow providing a premadeHttpClient
.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.
The text was updated successfully, but these errors were encountered: