bitcoin-on-twitch icon indicating copy to clipboard operation
bitcoin-on-twitch copied to clipboard

Two Way Barrier for Authenticating ClientID and Secret for OAuth - Not Possible with Twitch/Streamlabs

Open SatoriHoshiAiko opened this issue 1 year ago • 1 comments

Hi there,

So I have been trying to set up the stream notifications extension in LNBits, and I have discovered that perhaps since this was implemented as an extension in LNBits, the Stream Notifications will not function properly because of the OAuth2 process and how both Twitch and StreamLabs have built their registration system.

To Reproduce:

Install LNBits and Stream Notifications Extension Follow The Guide in the Documentation for LNBits in legacy Upon Creating "Add Service" enter twitch username and Use Streamlabs for Notification Service. Asks for Client ID and Client Secret Go to Twitch or StreamLabs and Follow their Documentation for Registering an App for their API The registration process requires the Redirect URI (in my case it would be: [https://sats.satorinet.love] https://sats.satorinet.love/streamalerts/api/v1/authenticate/* ( requires an API string where * is )

This does not exist and is not created because the extension wants first the client ID and secret before generating a redirect URI

The Client ID and Secret do not exist because Twitch and StreamLabs want a valid redirect URI during the registration process before offering the Authentication token.

One cannot Authenticate with OAuth2 because both requirements require one another and therefore cannot be done.

Is it possible to generate a redirect URI for the service in question first in LNBits without requiring the Client ID and Client Secret to generate one, so that we can add it when Registering with Twitch or StreamLabs.

And then input the Client ID and Secret as given by Twitch/Streamlabs to LNBits and continue with OAuth2 Authentication in LNBits.

My guess is this was designed before Twitch and StreamLabs created a developer App registration process, or made adjustment to it, and beforehand it would have been possible to obtain the ID and Secret with them before having a redirect URI. Now they have barricaded the registration process and this Stream Notifications extension will be impossible to create a service with, it is not up to date with their process. All that is needed to to generate the redirect URI before entering the ID and Secret and not after.

Thanks

SatoriHoshiAiko avatar Mar 13 '23 10:03 SatoriHoshiAiko

Hey there, thanks for opening the issue! I personally no longer maintain the extension, and I don't want to work with Streamlabs anymore in general. I think you guess is correct. If Streamlabs implemented a new app registration process, that is likely the problem. I've used StreamElement's current API for personal project before, and should I come back to this, I would probably replace Streamlabs with StreamElements. But since I currently have no time to work on the extension, it might be best to ask if anyone in the lnbits repo or Telegram group would be willing to investigate this. I'm sorry for the inconvenience. I will leave this issue here open, and you can link back to it!

Fittiboy avatar Mar 13 '23 11:03 Fittiboy