Authenticate user when they login from chat iframe

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.

Thanks

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.

Thanks for the reply. Is there a way using the API to authenticate users who log into chat without using the iframe?

Currently, I authenticate them with a button and don’t want them to have to log in twice (once for my site, and once for the chat).

Thanks

How are you embedding chat? The chat embeds should use the currently logged in Twitch user, so there shouldn’t be a double login.

To answer your question directly: there is no API for logging a user in. Just the two auth flows in the documentation.

Yes that is correct.

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.

Thanks

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