I am using the chat iframe and would like to be able to authenticate users from their logging in to the chat. Currently, I authenticate using the procedure here:
where the login is done via:
$(’.twitch-connect’).click(function() {
Twitch.login({
redirect_uri: REDIRECT_URI,
scope: [‘user_read’, ‘channel_read’]
});
})
Is there a way to do this when the user logs in to the chat as well? It seems silly to log in via chat and then have to log in by clicking the button as well.
No, there isn’t a way to use the authentication from the chat embed. The iframe is on another domain, and the cookies and authentication information aren’t shared for security reasons.
If the user is auth’d from my site then they are automatically logged in.
However, it is case two that is annoying. They log in to the chat before being auth’d by my site, in which case they would have to be auth’d by my site as well (2 log ins).
Perhaps I could force a log in before they get to my site, but I don’t want to do this.