Result is below.
{
“access_token”: “{tokenValue}”,
“refresh_token”: “”,
“scope”: [
“chat_login”
],
“expires_in”: 5272120
}
So, I used the tokenValue in below source .
[This source’s position is in Get started>Code Samples>Chat>javascript]
index.html…
window.chatClient = new chatClient({
channel: ‘#{channelid}’,
username: ‘{my_userid}’,
password: ‘oauth:{tokenValue}’
});
…
App access tokens are using to authenticate your application so they cannot take any action on behalf of another user such as logging into chat. They are currently only useful for Drops and higher rate limits in Helix right now.
Make sure chat_login is listed in scopes and the username of the person logging in is in the user_name field. This make check if the token is even valid.
After I tested as 1). I called URL that you suggested me.
And I got result like below.
{“error”:“Bad Request”,“status”:400,“message”:“No client id specified”}
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.