In Jenkins, if you go to Dashboard > USERNAME > View oauth access tokens, you will see the following:

      However, the revoke button does not work. Clicking the revoke button will only effectively refresh the page without revoking the token.

      This is because the file, "src/main/java/com/atlassian/bitbucket/jenkins/internal/jenkins/oauth/token/OAuthTokenConfiguration.java" will only remove the token if the post form data includes the key value pair of <oauth token>="Revoke". However, the key value pair actually present in the form data is <oauth token>="".

      This means that line 43 in the screenshot below will not find this expected key value pair and the token will not get revoked. Instead, if we modify line 43 to check for an empty string instead of "Revoke", the token will get revoked:

      .filter(e -> e.getValue().length == 1 && e.getValue()[0].equals("")) 

            aputland Austin
            aputland Austin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: