Skip to content

Log FW Lite sign-in lifecycle and make log levels configurable - #2730

Open
hahn-kev-bot wants to merge 1 commit into
developfrom
fw-lite-login-logging
Open

hahn-kev-bot wants to merge 1 commit into
developfrom
fw-lite-login-logging

Conversation

@hahn-kev-bot

@hahn-kev-bot hahn-kev-bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

I've got some more changes coming to make this even easier for users to enable debug logging.


AI summary

Context: a user behind a VPN completed a browser login and Chrome landed on localhost:53021 with "refused to connect". MSAL's loopback listener lives only inside the FW Lite process and only until the first request, and app.log could not tell us what happened: MSAL's listener messages are filtered to Warning in code, and our own code logged nothing about the sign in.

  • AuthService.SignInWebView logs start, success and failure with elapsed time and the server. Unclassified failures are logged at Error before being rethrown.
  • OAuthService logs the loopback redirect URI (so the port) when it opens the browser, using a new AuthConfig.OpenSystemBrowser hook. MAUI fills it with Launcher.Default.OpenAsync, which replaces MSAL's own Process.Start on Windows only; Android and the Mac Catalyst custom web UI path never use it. It also warns when the app stops with a sign in still waiting for the browser, which is the "refused to connect" scenario.
  • FwLiteMauiKernel reads log filters from configuration via logging.AddConfiguration instead of hard-coded AddFilter calls. The former filters become FwLiteMauiKernel.DefaultConfiguration, registered in MauiProgram before environment variables, so a user can raise a category for one session: Logging__LogLevel__FwLiteShared.Auth.LoggerAdapter=Information turns on MSAL's "Listening for authorization code on http://localhost:PORT/" and "HttpListener stopped" messages.

A friendlier way to inject this configuration (a settings file or a UI toggle rather than env vars) is being designed separately.

Test plan

  • FwLiteMaui Windows target builds on top of develop
  • dotnet test backend/FwLite/FwLiteShared.Tests --filter FullyQualifiedName~Auth passes
  • Manual: sign in on Windows and confirm app.log shows the start line with redirect_uri=http://localhost:<port> and the success line
  • Manual: set Logging__LogLevel__FwLiteShared.Auth.LoggerAdapter=Information and confirm MSAL's listener messages appear

🤖 Generated with Claude Code

A field report of "localhost refused to connect" after a browser login
could not be diagnosed from app.log: MSAL's listener messages are
filtered to Warning in code and our own code logged nothing about the
sign in. Now:

- AuthService logs sign-in start, success and failure with elapsed time.
- OAuthService logs the loopback redirect URI (port) when it opens the
  browser, via a new AuthConfig.OpenSystemBrowser hook that MAUI fills
  with Launcher.Default.OpenAsync, and warns when the app stops with a
  sign in still waiting for the browser.
- Log filters come from configuration instead of hard-coded AddFilter
  calls. Defaults are registered before environment variables, so a user
  can raise a category for one session, e.g.
  Logging__LogLevel__FwLiteShared.Auth.LoggerAdapter=Information.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce05d856-9261-4c3f-8d7d-791ec1f91de3
📥 Commits

Reviewing files that changed from the base of the PR and between 4e1a664 and 547584a.

📒 Files selected for processing (5)
  • backend/FwLite/FwLiteMaui/FwLiteMauiKernel.cs
  • backend/FwLite/FwLiteMaui/MauiProgram.cs
  • backend/FwLite/FwLiteShared/Auth/AuthConfig.cs
  • backend/FwLite/FwLiteShared/Auth/AuthService.cs
  • backend/FwLite/FwLiteShared/Auth/OAuthService.cs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Oct 6, 2026
@argos-ci

argos-ci Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 6, 2026, 10:18 AM
e2e (Inspect) ✅ No changes detected - Oct 6, 2026, 10:26 AM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants