-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempted Use With Blazor wasm return "Property AllowAutoRedirect is not supported." #2188
Comments
@microhobby let's start from there, as I don't have much control over The relevant code is here: octokit.net/Octokit/Http/HttpMessageHandlerFactory.cs Lines 18 to 21 in 74dc51a
|
Exactly same bug here :-( |
It works on .net core |
@HasinduLanka I need more information to understand the problem you're seeing |
When you try to authenticate Octokit in blazor, which runs on .net standard framework, you get the above error It seems aws are also getting the same problem |
@HasinduLanka the only area I'm aware of where we enable these in the library is here: octokit.net/Octokit/Http/HttpClientAdapter.cs Lines 30 to 53 in 69d1182
This is only enabled for octokit.net/Octokit/Octokit.csproj Lines 27 to 29 in fe6639f
This shouldn't be enabled for .NET Standard as we don't include that |
I was playing with this error for few hours. Things I saw,
So I get It's framework issues, I'm very thankful for helping us on these :-) |
It looks like Blazor Web Assembly doesn't have AllowAutoRedirect property because HttpClientHandler is implemented via JavaScript APIs. This guy has Modified octokit.net to use with blazor He changed of When I do that it still says Exactly same code runs well on .net core |
… that this can be used in .net core 3.0 and blazor.
@HasinduLanka, I agree with your observation on why I assume there must be a reason why Octokit prevents As with the auth issue, I suppose it is because Basic Auth is deprecated. I have tried with my Personal Access Token and it is working for me. I used below syntax
It might be worth retrying with a PAT after 2FA is enabled just to see if it is an issue with Basic Auth. |
@martinmthomas from memory this is still kept around due to behaviour around edge cases that have built up over the years: octokit.net/Octokit/Http/HttpClientAdapter.cs Lines 225 to 252 in b9d1f44
The blame for this file has more context and links to the relevant commits, and I think there were cases around us having to explicitly handle things better than the defaults on Windows (where this library originated) that may no longer be necessary. |
Everyone, thank you very much - Issue is fixed!Just like @shiftkey said I removed the line Then octokit didn't authenticated because, HTTPClient get redirected and doesn't return the correct result back when using password authentication. But just like @martinmthomas said, this doesn't occur in Personal Token Based Auth. So using token instead of password allowed me to Authenticate without any error. p.s. I'll make this repo public as soon as our 'Account servers' are ready. So anyone could cope with this Again thanks for quick help! |
Seems very much related to this dotnet/runtime issue: [wasm] Blazor 303 responses, and fetch vs navigation #39365 |
as per [this comment](octokit#2188 (comment))
👋 Hey Friends, this issue has been automatically marked as |
I am trying to use the library with Blazor wasm template but this returns the stack:
I know this must be a limitation of Blazor wasm. But I'm curious if anyone has the same problem and if there is any workaround. Or if we should open an issue in the dotnet project (I really don't know why AllowRedirect is not supported by Blazor wasm)
The text was updated successfully, but these errors were encountered: