dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.7k stars 423 forks source link

[WebToolsE2E][Aspire][Mac] There is no response and can't go to aspire dashboard page when running the Aspire app with "http" and open URL with token in the Safari browser. #4413

Open Rita003 opened 3 months ago

Rita003 commented 3 months ago

REGRESSION INFO: Also repro on Aspire 8.0.1

INSTALL STEPS

  1. Clean machine: MacOS
  2. Install SDK 8.0.302
  3. Install Aspire 8.1 Preview 1

REPRO STEPS 1.Open CMD, create an Aspire App using following commands:

dotnet new aspire -o aspire
cd aspire/aspire.AppHost
  1. Set the "ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true" in the launchSettings.json of the aspire.AppHost project

  2. Dotnet run the project in CMD, and open URL with token: dotnet run

  3. Go back to the Command Prompt and enter "Ctrl + C" to shut down the application

  4. Run the project with http in CMD, and open URL with token: dotnet run -lp http

ACTUAL: There is no response and can't go to aspire dashboard page, if copy the URL token to browser, it still cannot log in. image (22)

Workaround

  1. Open Safari Settings > Click "Manage Website Data" in privacy page > Click "Remove All" to clear the localhost cookie history
  2. Run the aspire project with http and open URL with token, it will not pop-up token page and works well

NOTE:

  1. This issue only repro on Safari browser [Version 17.5 (19618.2.12.11.6)], this issue not repro on Edge browser.
  2. This issue also repro when debug the project in VS Code after dotnet run the project.
  3. Run aspire project with https in CLI and open URL with token, it works well.
  4. There is a similar closed known issue: #3942

EXPECTED Open URL with token not pop-up token page and works well image (23)

mitchdenny commented 3 months ago

@adamint or @drewnoakes PTAL.

adamint commented 2 months ago

I cannot reproduce this, again. @Rita003 please re-test

Rita003 commented 2 months ago

@adamint I can repro this issue after installing the latest Aspire 8.1.1-preview.1.24380.4 in today's validation. You can try to run the project with https first, then run the project with http. The repro step as below:

  1. Dotnet run the project with https in CMD, and open URL with token in the browser: dotnet run
  2. Stop running the project, then run the project with http in CMD, open URL with token: dotnet run -lp http
adamint commented 6 days ago

@Rita003 could you try to repro once more? thanks.

This seems like an issue with how Safari manages cookies.

Rita003 commented 5 days ago

@adamint I can still repro this bug, it seems like an issue with Safari manages cookies. As described in the workaround: If we open Safari Settings > Click "Manage Website Data" in privacy page > Click "Remove All" to clear the localhost cookie history, then run the aspire project with http and open URL with token, it will not pop-up token page and works well

adamint commented 5 days ago

@adamint I can still repro this bug, it seems like an issue with Safari manages cookies. As described in the workaround: If we open Safari Settings > Click "Manage Website Data" in privacy page > Click "Remove All" to clear the localhost cookie history, then run the aspire project with http and open URL with token, it will not pop-up token page and works well

I don’t yet know where to file it, but this should be classified as an external bug on WebKit/Safari instead of Aspire. We should keep the issue here open until more investigation is done so that we can submit a comprehensive bug report, but I am fairly confident at this point in saying that this is not our bug