onAuthorized not firing in Hosted Test

I have been trying to solve this issue in my extension for a few days.

My onAuthorized callback has been working fine in local test using the native dev rig. However when I moved to Hosted Test, I am no longer receiving access to the viewer’s id. I feel like I must be doing some wrong, but can’t figure out what.

When my onAuthorized callback runs, my JS will console.log the viewer’s id (my extension has “Request Identity Link” set to Yes. and if i detect that Twitch.ext.viewer.id is null, then i show an “Authorize” button to perform a requestIdShare).

When locally testing in the rig, with a view for Logged In User, Identity Linked, it fires onAuthorized automatically, i grab their JWT, pass it up to my EBS and fetch their displayname via Twitch API, etc, and everything is great.

When doing a Hosted Test on my channel (note: i have a second account, whitelisted for testing, as the Viewer), I see that onAuthorized does not fire automatically. Then I click my Authorize button and use the RequestIdShare dialog to grant access. But it still doesnt fire onAuthorized. I also added a button to simply console.log(window.Twitch.ext.viewer.id) when i click it, and it’s always null, even after Granting access to my id.

Does it sound like I’m missing something?
There are no errors in my browser console.

I am seeing the same thing now. Did you ever figure out what was going on?

It’s unwise to necro a 4 month off post.

Show your code.

Usually if it’s not firing you have your code in the wrong order, it wasn’t loaded or something else occured

This was a Twitch bug that has now been fixed, thankfully.

There was no code to show in this instance, other than the declaration of the onAuthorized callback. Not tremendously interesting:

var twitch = window.Twitch.ext;


twitch.onAuthorized(function(auth) {

The error occurred when the broadcaster was trying to use their own extension. I did not get the full details on why it was not happening for my extension, but it is fixed now. I wonder if something similar happened for the four month old thread. I wondered why it was sitting alone and ignored for four months in a corner of the internet. :slight_smile:

The only thing unique to my extension is that I don’t use a framework.

Thanks for the tips, @BarryCarlyon!