onAuthorised is called on every page load, so not sure what you are doing wrong
The github example I linked to is a fully working extension.
With a Readme that covers how to get it up and running to play with/test
The backend can be replaced with a backend in any language, and it covers the “simplest” method to get the users profile from an onAuthorised callback
Send the JWT to an EBS Rest Endpoint
EBS extracts the userID from the JWT
EBS middleman’s the request to Twitch, using an appropriate oAuth token