-
Notifications
You must be signed in to change notification settings - Fork 474
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
Fix dashboard auth when unsecured #5499
Conversation
|
var scheme = GetRelevantAuthenticationScheme(); | ||
if (scheme == null) | ||
{ | ||
var id = new ClaimsIdentity([new Claim(OtlpAuthorization.OtlpClaimName, bool.FalseString)]); | ||
return AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is what didn't work with SignalR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It worked with the initial request (otherwise the page would have been a 401) but didn't with SignalR,. The SignalR failed then flowed into Blazor, which then caused the authorized route view component to display Unauthorized.
/backport to release/8.2 |
Started backporting to release/8.2: https://github.com/dotnet/aspire/actions/runs/10692819322 |
Has this been released? I am running into this problem as well due to https needing disabled to work with a custom container component that cannot trust dotnet dev-certs. |
Would like to know as well. Just started a new project yesterday with freshly updated workload and nuget packages. |
@joperezr When does the 8.2 patch ship? |
For consumers of docker image: The 8.2.0 version of the container that has the fix for this has shipped to the nightly registry of MCR. It can be found here: https://mcr.microsoft.com/en-us/product/dotnet/nightly/aspire-dashboard/ and can be pulled via For people using .NET Aspire dashboard via the AppHost (most common case): The fix will ship in .NET Aspire 8.2.1 patch, which is scheduled to ship on 9/26. |
Description
Fixes #5490
Fixes #4851
Changes to auth caused the dashboard's unsecured mode to fail. I don't exactly understand what is going on, but I think that:
HttpContext.User
would be set with a claim <- goodAuthorizeRouteView
in dashboard sees unauthorized user and displays message in browser.I fixed this by making an auth scheme handler just for unsecured mode and made it the default auth scheme if dashboard is configured to be unsecured. My guess is the SignalR was attempting to run the default auth scheme (cookies) when it gets its user and was failing because cookies isn't used in unsecured mode.
I'm not sure how to test this simply. It might require a playwright test 😬
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow