I am having trouble logging in to IRC. I requested a token with the chat_login scope using the client credentials flow as described here:
I am also prepending my token with “oauth:” when sending it. However I am getting “NOTICE Error logging in” after attempting to log in.
It does work when I generate a token with the OAuth password generator (https://twitchapps.com/tmi/). However, I would like to generate the token with the authentication API so that I can regenerate it when it expires.
You requsted as “OAuth Client Credentials Flow (App Access Tokens)”
You need a “OAuth Authorization Code Flow (User Access Tokens)”
3) On your server, get an access token by making this request:
POST https://api.twitch.tv/kraken/oauth2/token
?client_id=<your client ID>
&client_secret=<your client secret>
&code=<authorization code received above>
&grant_type=authorization_code
&redirect_uri=<your registered redirect URI>