You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Octokit to download GitHub releases, this worked fine for months but suddenly stopped working as of today, with the following error:
HttpError: <Error><Code>AccessDenied</Code><Message>Multiple auth mechanisms are not allowed; please use either query parameters or an Authorization header</Message>
This is the function I use to download the release:
I assume that something changed in the GitHub API making authorization stricter? When downloading the file, GitHub redirects to another url. This redirected URL contains authentication information. I guess that Octokit then uses this URL but still also includes the authorization header containing the personal access token. This combination results in a failure.
I assume that something changed in the GitHub API making authorization stricter? When downloading the file, GitHub redirects to another url. This redirected URL contains authentication information. I guess that Octokit then uses this URL but still also includes the authorization header containing the personal access token. This combination results in a failure.
I've been experiencing the same problem with Dart's http package for the last three days, and this part of your comment made my day :). For anyone looking for a workaround, here is what I did:
...
finalClient _client =Client();
...
// Configure a request object to not to follow redirects and 'send' itfinal request =Request('GET', ASSET_URI)
..followRedirects =false
..headers.addAll(YOUR_HEADERS);
final redirectResponse =await _client.send(request);
// Extract file location from headersfinal location = redirectResponse.headers['location']!;
// Make the actual request for downloadfinal response =await _client.get(Uri.parse(location));
...
What happened?
I use Octokit to download GitHub releases, this worked fine for months but suddenly stopped working as of today, with the following error:
This is the function I use to download the release:
The part that fails is the actual download of the file:
What did you expect to happen?
Octokit to properly download the release asset as described in the docs: https://docs.github.com/en/rest/reference/repos#get-a-release-asset
What the problem might be
I assume that something changed in the GitHub API making authorization stricter? When downloading the file, GitHub redirects to another url. This redirected URL contains authentication information. I guess that Octokit then uses this URL but still also includes the authorization header containing the personal access token. This combination results in a failure.
Example of requested file:
Example of the URL containing credentials it redirects to (simplified/shortened):
I can actually get it to work when rewriting the download part of my function using an external http library (I used got):
The text was updated successfully, but these errors were encountered: