-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
.Net Core Console connect signalR 401 under windows authentication #6120
Comments
Is |
This is my
Check SignalRPro for reproducable demo. |
Take a look at our docs for windows auth https://docs.microsoft.com/aspnet/core/security/authentication/windowsauth?view=aspnetcore-2.2 Once I added the |
Is there any difference between hosting in IIS and IIS Express? Currently, I am developing with VS and IIS Express, I did not receive any error related with Do you make it work with my demo project? |
I made your demo project work with hosting in IIS, didn't try with IIS Express, but the docs I linked also talk about IIS Express. |
How to make my project work with IIS Express? |
Ok, looked into this and it turns out that for security reasons this scenario of redirecting to https with auth doesn't work by default. See https://docs.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest.credentials?view=netframework-4.7.2#remarks for info. It looks like you can create a |
I am using |
Use the |
Any sample for setting |
Nope, you'll be the first time I've heard of someone doing it. |
If so, is it expected result that receiving 401 when signlaR client requests server with http which secured with windows authentication? How could |
var connection = new HubConnectionBuilder()
.WithUrl("<SOME ENDPOINT>", options =>
{
var handler = new HttpClientHandler()
{
Credentials = /*CONFIGURE YOUR CREDENTIAL CACHE*/
};
options.HttpMessageHandlerFactory = (_) => handler;
}).Build(); The code would look something like this. |
Closing this as we haven't heard from you in a little while. Please feel free to comment if you're able to get the information we're looking for and we can reopen the issue if we're able to identify the problem. |
Describe the bug
When .net core signalR console app connect signalR server with Windows Authentication, receive 401.
To Reproduce
Steps to reproduce the behavior:
netcoreapp2.1
with Windows Authentication enabled.Expected behavior
Console App connect signalR server correctly.
Current behavior
Receive error 401 at console app.
Update:
After making a test with
https
andhttp
url in client signalr, it works with https url, it seemsapp.UseHttpsRedirection();
at server side fail to redirect the client credential while redirecting http to https.The text was updated successfully, but these errors were encountered: