Inconsistent JWT token value between developer rig and production

Developer rig currently requires developer to enter the channel name and user name as a part of the environment variable for initialization. The values are then returned as a part of the JWT from onAuthorized(). Here is an example of what developer rig returns:

“channelId”:“lirik”,“clientId”:“xxxxxx”,“token”:“xxxxxx”,“userId”:“URIGlirik”

As you can see here, the developer rig returns the channel id and user id as a string instead of an ID, which is incorrect because the production environment returns a numerical ID.

If I were to change the initialization environment variable to an ID instead of a string name the developer rig will simply fail to start up. Why is developer rig doing this behaviour when many extensions heavily rely on the testing of the JWT authentication model (at identifying between the broadcaster, logged-out viewer and logged-in viewer)?

For example, in production, I have to call the API to translate the user ID and channel ID back into a name, but the developer rig does not follow that model because it returns the string name directly.

thanks for bringing this up!

should be a straight forward fix (famous last words). i will work on this first thing next week.

for now (i’m not certain this will work but i’m pretty sure), if you wanted to change the usage of channelId in the calls to createSignedToken here - https://github.com/twitchdev/developer-rig/blob/master/src/util/token.js#L8 that should get you what you want.

1 Like