# Unauthorized 401

**URL:** <https://discuss.dev.twitch.com/t/unauthorized-401/12047>\
**Category:** Extensions\
**Created:** [September 17, 2017, 11:03pm UTC](https://discuss.dev.twitch.com/t/unauthorized-401/12047 "2017-09-17T23:03:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkubatko](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dkubatko/32/4100_2.png) [@dkubatko](https://discuss.dev.twitch.com/u/dkubatko)\
**Post date:** [September 17, 2017, 11:03pm UTC](https://discuss.dev.twitch.com/t/unauthorized-401/12047/1 "2017-09-17T23:03:24Z")

</div>

I am confused. I keep getting Unauthorized while trying to PUT configuration settings.  
I am doing JWT payload that looks like this:  
{  
“exp”: 1505774570,  
“role”: “external”,  
“user\_id”: “43665292”  
}  
(Parsed through [jwt.io](http://jwt.io))  
I am setting my Client-id and Extension id from the overview page of my extension and I still get  
{“error”:“Unauthorized”,“status”:401,“message”:“authentication failed”}. Why? What is happening?  
My extension id is 277906 (doesn’t look like real id for some reason) and maybe that causes the error. I am on the local test page of my extension.  
Request looks like this (I get 401 for any kind of requests):  
curl -H ‘Authorization: Bearer ‘token’’  
-H ‘Client-Id: ebfbsgj6lg9k2d4czcycledd89vrz9’  
-X GET [https://api.twitch.tv/extensions/277906/auth/secret](https://api.twitch.tv/extensions/277906/auth/secret)  
{“error”:“Unauthorized”,“status”:401,“message”:“authentication failed”}.  
What should I do? Thank you in advance.

---

<div class="post-metadata">

**Author:** ![dkubatko](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dkubatko/32/4100_2.png) [@dkubatko](https://discuss.dev.twitch.com/u/dkubatko)\
**Post date:** [September 18, 2017, 5:31am UTC](https://discuss.dev.twitch.com/t/unauthorized-401/12047/2 "2017-09-18T05:31:49Z")

</div>

Could I get any help? I couldn’t do anything with that. I have no control over it.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 18, 2017, 8:07am UTC](https://discuss.dev.twitch.com/t/unauthorized-401/12047/3 "2017-09-18T08:07:59Z")

</div>

> [@dkubatko](#):
>
> [https://api.twitch.tv/extensions/277906/auth/secret](https://api.twitch.tv/extensions/277906/auth/secret)

277906 is the wrong ID, use the LONG one. Labelled as “Client ID”

Also make sure when you have your secret to base64 decode it before using it in JWT operations

---

<div class="post-metadata">

**Author:** ![dkubatko](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dkubatko/32/4100_2.png) [@dkubatko](https://discuss.dev.twitch.com/u/dkubatko)\
**Post date:** [September 18, 2017, 7:30pm UTC](https://discuss.dev.twitch.com/t/unauthorized-401/12047/4 "2017-09-18T19:30:12Z")

</div>

Thank you.  
It actually was the problem with my extension id. It’s kinda of confusing to name random number Extension ID and then ask for another one with the same name. Anyways, everything is ok now. Thank you again.

---

<div class="post-metadata">

**Author:** ![PaintedUniverse](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@PaintedUniverse](https://discuss.dev.twitch.com/u/PaintedUniverse)\
**Post date:** [November 28, 2017, 2:21am UTC](https://discuss.dev.twitch.com/t/unauthorized-401/12047/5 "2017-11-28T02:21:28Z")

</div>

I am getting the same error, but it’s when I try to verify my email? I don’t understand why it’s doing this, and when it does say that is sent, it never does send, I reload my email at least like 10 times, wait an hour and there is still not conformation email, can someone please help me? Lol. idk, some twitch chats I go in need a verified email, and since I changed my email, it won’t verify it, I need help.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [November 28, 2017, 9:26am UTC](https://discuss.dev.twitch.com/t/unauthorized-401/12047/6 "2017-11-28T09:26:23Z")

</div>

You necroed a thread that is irrelevant to your problem…

Please see [help.twitch.tv](http://help.twitch.tv)
