# Failed to obtain access token

**URL:** <https://discuss.dev.twitch.com/t/failed-to-obtain-access-token/18324>\
**Category:** API\
**Created:** [October 20, 2018, 6:00pm UTC](https://discuss.dev.twitch.com/t/failed-to-obtain-access-token/18324 "2018-10-20T18:00:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doobie](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Doobie](https://discuss.dev.twitch.com/u/Doobie)\
**Post date:** [October 20, 2018, 6:00pm UTC](https://discuss.dev.twitch.com/t/failed-to-obtain-access-token/18324/1 "2018-10-20T18:00:21Z")

</div>

Hey so I am trying to authenticate with passport, I am using this package: [https://www.npmjs.com/package/passport-twitch.js](https://www.npmjs.com/package/passport-twitch.js)

I have tried other packages as well but I always get the same error message: InternalOAuthError: Failed to obtain access token

What am I doing wrong with my strategy?

```
passport.use(
    new TwitchStrategy({
        clientID: keys.twitchClientID,
        clientSecrect: keys.twitchClientSecrect,
        // callbackURL:'/auth/twitch/callback',
        callbackURL:'http://127.0.0.1:5000/auth/twitch/callback',
        scope: "user:read:email analytics:read:games",
        proxy: true
    }, (accessToken, refreshToken, profile, done) => {
        console.log(accessToken);
        console.log(profile);
    })
```

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [October 20, 2018, 10:03pm UTC](https://discuss.dev.twitch.com/t/failed-to-obtain-access-token/18324/2 "2018-10-20T22:03:49Z")

</div>

`clientSecrect` should be `clientSecret` (and see if you have a typo in the `keys.twitchClientSecrect` as well)

---

<div class="post-metadata">

**Author:** ![Doobie](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Doobie](https://discuss.dev.twitch.com/u/Doobie)\
**Post date:** [October 20, 2018, 10:20pm UTC](https://discuss.dev.twitch.com/t/failed-to-obtain-access-token/18324/3 "2018-10-20T22:20:04Z")

</div>

INSANSE!. Thank you omg i feel so stupid I was fighting for hours on this, I was like what the heck why isnt this working?!!! Damn typo lol

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [October 21, 2018, 2:10pm UTC](https://discuss.dev.twitch.com/t/failed-to-obtain-access-token/18324/4 "2018-10-21T14:10:46Z")

</div>

Sometimes you just need another pair of eyes.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [November 20, 2018, 2:10pm UTC](https://discuss.dev.twitch.com/t/failed-to-obtain-access-token/18324/5 "2018-11-20T14:10:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
