Skip to content

Detect if scopes are valid #1260

Description

@Kesuaheli

Prerequisites

  • If this is a question/suggestion, I have already considered discussing it on the Discord Server
  • I have attempted to look for similar github issues already

Description

When providing a tokes which lacks the required scopes, there is no way of handling the error in code.

With #605 Twitch4J added logging, which kinda works, but is only available for the user.

It would be cool to have the possibility to handle fallbacks or show custom error message in gui.

Alternatives

Afaik there's no alternative way, just watching the log

Additional Context

I'm developing the Minecraft Fabric Mod Twitch Chat Bridge and I use the Twitch4J-Fabric wrapper (obviously)

Therefore I have the end user (who I have no control of) to generate and enter a token for their account.
If they generated a wrong token (with missing scopes) the mod simply wont work and the user has no real way of knowing why. Only if they spot the logging messages, which basically nobody does because I assume most don't know what to look for.
I rather want to catch this error in code and show a better message in the game itself.

Activity

  1. iProdigy commented on Jun 6, 2026

    @iProdigy
    Member

    I agree we could dynamically surface missing scope warnings better.

    For now you can use TwitchIdentityProvider#getAdditionalCredentialInformation to determine what scopes the token has (and compare it to a hardcoded list of scopes you know your application needs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions