Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-4567

API: find out whether I'm authenticated (BB-5268)

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      I wrote a backup tool for Bitbucket repositories (Bitbucket Backup...you're featuring it on your "Explore Bitbucket" page) and I'm using the Bitbucket API to get a list of a user's repositories to backup.

      My app asks the users for their username and password, and authenticates with the Bitbucket API to get their private repositories as well.

      The thing is, I can't tell whether I'm authenticated or not. If the user enters the wrong password, the API returns only the public repositories, but my app can't tell that the authentication failed and that the private repositories are missing in the result.

      So my app silently backs up public repositories only, and is not able display an error message to the user :-/

      --> I need a way to find out whether I'm authenticated or not.

      In the past I was able to tell this, because the API returned only a subset of the repository information when making a non-authenticated request.
      Some of the repositories' properties were only returned on authenticated requests, so I just checked one of these (//has_wiki//) and when it was missing, I displayed a "wrong password" message.

      But this doesn't work anymore, apparently the API was changed because of this issue:
      https://bitbucket.org/site/master/issue/3439/unauthenticated-repo-api-results-lack

      Attachments

        Activity

          People

            Unassigned Unassigned
            e287b7893469 christianspecht
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: