How to get access_token for using chat?
I have tried to use chat. so I need access_token.
window.chatClient = new chatClient({
channel: ‘#CHANNELNAMEHERE’,
username: ‘USERNAMEHERE’,
password: ‘oauth:AUTHTOKENHERE’, <- I need how to get this token value in code(client javascript or node).
});
[Authentication>Node Sample source]
passport.use(‘twitch’, new OAuth2Strategy({
authorizationURL: ‘https://api.twitch.tv/kraken/oauth2/authorize’,
tokenURL: ‘https://api.twitch.tv/kraken/oauth2/token’,
clientID: TWITCH_CLIENT_ID,
clientSecret: TWITCH_SECRET,
callbackURL: CALLBACK_URL,
state: true
},
function(accessToken, refreshToken, profile, done) {
profile.accessToken = accessToken; <- Is different this token below?
profile.refreshToken = refreshToken;
// Securely store user profile in your DB
//User.findOrCreate(..., function(err, user) {
// done(err, user);
//});
done(null, profile);
um…
I think that I didn’t deliver what to want.
I do authentication for sign-in via twitch. And I take live chat message from channel.
but I used user_read in scope.
So, I want what to do authentication via twitch. And the accessToken want to use to take chat message.
Is this possible? or Is take each accessToken ?
I testing source below.(There is this source in Get started with Twitch development)
window.chatClient = new chatClient({
channel: ‘#CHANNELNAMEHERE’,
username: ‘USERNAMEHERE’,
password: ‘oauth:AUTHTOKENHERE’, <- Not use?
});