I do not think you are fully understanding the OAuth handshake process.
Since you appear to be creating a client side application you want to to use the OAuth Implicit Code Flow.
The general process is as follows:
- User opens your application and clicks Login and is directed to:
https://api.twitch.tv/kraken/oauth2/authorize?client_id=<your client ID>&redirect_uri=http://localhost:3000/public/chatbot.html&response_type=token&scope=chat_login - User accepts the OAuth request via their browser and is redirected back to your application at the redirect_uri
- The app access token will be in the URL hash:
http://localhost:3000/public/chatbot.html#access_token=XXXXXXX&scope=chat_login - You pull the access_token from the hash and then pass it to your IRC connection logic.