Authentication for embedded chat in iOS/Android app

Not sure if this is the right venue for this, but I’m trying to build a react native app that has twitch video and chat embedded in it. The only way that I currently know how to do this is using the embedded chat/video inside of a WebView.

The issue with this approach is that in order for the user to post chat msgs, it seems like login must happen inside the WebView, and that I have no way of doing this with the app’s react native UI. Login inside a WebView would be unacceptable because I don’t have control over the UI. I thought about trying to have the user enter in their username/password inside the app, and then trying to authenticate with JS request inside the WebView, but that request requires a valid CSRF token, and I don’t know how to obtain one easily. I also don’t like the idea of storing the user’s Twitch password in my app…

Is there some way to be able to use the API credentials to authenticate for embedded chat?

oAuth implicit should work for this.

Thanks for the response. All the documentation I’ve read shows how to use oauth tokens in requests to the API, but not to non-API endpoints (e.g. the URL for chat embedding). Do you know how I would present that token for such a request?

Ah, you can’t!

The docs for embedding chat are here:

And basically YOU personally cannot (and should not) handle the authentication.

The iframe will present the relevant forms for users to login with.

You could use a chat_login scope and build a custom chat for send/receive chat over websocket, but I wouldn’t suggest that for your usecase

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.