# \[SOLVED\] Can't get 'chat\_login' scope working

**URL:** <https://staging-discuss.dev.twitch.com/t/solved-cant-get-chat-login-scope-working/12033>\
**Category:** Extensions\
**Created:** [September 16, 2017, 6:44pm UTC](https://staging-discuss.dev.twitch.com/t/solved-cant-get-chat-login-scope-working/12033 "2017-09-16T18:44:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ncee](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@ncee](https://staging-discuss.dev.twitch.com/u/ncee)\
**Post date:** [September 16, 2017, 6:44pm UTC](https://staging-discuss.dev.twitch.com/t/solved-cant-get-chat-login-scope-working/12033/1 "2017-09-16T18:44:03Z")

</div>

Hello,

I am trying to figure out why I can’t get chat\_login scope to work for me.

My current setup is i set ‘chat\_login’ under ‘Extension Capabilities’ in the ‘Required Broadcaster Abilities’ field.

Then when I go to test my extension and activate it, it prompts me with the oauth flow in which i authorize it and successfully receive the code on the EBS side in a format like below:

{ code: ‘some token’,  
scope: ‘chat\_login’,  
state: ‘{“version”:“0.0.1”,“channel\_id”:somechannelid}’ }

Then I send my oauth receipt as defined here → [Extensions Reference | Twitch Developers](https://dev.twitch.tv/docs/extensions/reference#set-extension-broadcaster-oauth-receipt)

which i get a 204 status code and the window closes successfully and the extension gets activated.

The problem:

I tried using this token to authenticate via irc and it returns → :tmi.twitch.tv NOTICE \* :Login authentication failed

The following commands I entered to test this was (also tried ssl):

> telnet [irc.chat.twitch.tv](http://irc.chat.twitch.tv) 6667  
> PASS oauth:mytoken  
> NICK myusername

but using the same commands above…when I used Twitch’s Oauth Token Generator it was successful-\> [Twitch Chat Password Generator](https://twitchapps.com/tmi/)

The token from that generator worked but when getting a token through extensions oauth scopes, it would not work for me.

Any ideas?

Thank you

---

<div class="post-metadata">

**Author:** ![george](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/george/32/120_2.png) [@george](https://staging-discuss.dev.twitch.com/u/george)\
**Post date:** [September 16, 2017, 7:40pm UTC](https://staging-discuss.dev.twitch.com/t/solved-cant-get-chat-login-scope-working/12033/2 "2017-09-16T19:40:16Z")

</div>

You must complete steps 3 and 4 of the OAuth Authorization Code Flow to turn the `code` to an `access_token`: [https://dev.twitch.tv/docs/authentication#oauth-authorization-code-flow-user-access-tokens](https://dev.twitch.tv/docs/authentication#oauth-authorization-code-flow-user-access-tokens)

* * *

1. On your server, get an access token by making this request:

```auto
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>

```

Here is a sample request:

```auto
POST https://api.twitch.tv/kraken/oauth2/token
    ?client_id=uo6dggojyb8d6soh92zknwmi5ej1q2
    &client_secret=nyo51xcdrerl8z9m56w9w6wg
    &code=394a8bc98028f39660e53025de824134fb46313
    &grant_type=authorization_code
    &redirect_uri=http://localhost

```

1. We respond with a JSON-encoded access token. The response looks like this:

```auto
{
   "access_token": "<user access token>",
   "refresh_token": "<refresh token>",
   "expires_in": <number of seconds until the token expires>,
   "scope": <your previously listed scope(s)>
}

```

---

<div class="post-metadata">

**Author:** ![ncee](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@ncee](https://staging-discuss.dev.twitch.com/u/ncee)\
**Post date:** [September 16, 2017, 8:54pm UTC](https://staging-discuss.dev.twitch.com/t/solved-cant-get-chat-login-scope-working/12033/3 "2017-09-16T20:54:06Z")

</div>

Awesome got it working, thank you very much

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 17, 2017, 10:30am UTC](https://staging-discuss.dev.twitch.com/t/solved-cant-get-chat-login-scope-working/12033/4 "2017-09-17T10:30:08Z")

</div>

Side note: Whilst chat\_login is perfectly fine. Most casters don’t like to grant it [citation missing]

Make sure you document exactly why you need this scope/feature, and if you can actually just use the justinfan login instead do so…
