Skip to content

Tony/701_web_security_key - #48

Closed
tonypioneer wants to merge 2 commits into
devfrom
tony/701_web_security_key
Closed

Tony/701_web_security_key#48
tonypioneer wants to merge 2 commits into
devfrom
tony/701_web_security_key

Conversation

@tonypioneer

Copy link
Copy Markdown
Collaborator

Pull Request Details

Description

Fixed the issue that the security key can be retrieved from web localStorage.

Related Issues

anusii/solidpod#701

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How To Test?

Run the app on web browser, and follow the instructions in anusii/solidpod#701

Checklist

  • Screenshots included here/in linked issue #
  • Changes adhere to the style and coding guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules
  • The update contains no confidential information
  • The update has no duplicated content
  • No lint check errors are related to these changes (make prep or flutter analyze lib)
  • Integration test dart test output or screenshot included in issue #
  • I tested the PR on these devices:
    • Android
    • iOS
    • Linux
    • MacOS
    • Windows
    • Web
  • I have identified reviewers
  • The PR has been approved by reviewers

Finalising

  • Merge dev into the this branch
  • Resolve any conflicts
  • Add a one line summary into the CHANGELOG.md
  • Push to the git repository and review
  • Merge the PR into dev

@tonypioneer
tonypioneer requested review from gjwgit and a lite review from Copilot August 11, 2026 10:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a web security issue where Solid-OIDC session secrets (notably the DPoP private key) could be retrieved from browser localStorage by switching web storage to an in-memory OIDC store and adding a best-effort cleanup of legacy persisted values.

Changes:

  • Replaced OidcDefaultStore() with a platform-aware store (createSolidAuthStore()), using in-memory storage on web.
  • Added purgeLegacyWebSecrets() to remove previously persisted session parameters from web persistent storage.
  • Updated session-store wiring to use the same platform-aware storage selection.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/src/auth/solid_oidc_manager_factory.dart Switches OIDC manager store to platform-aware storage (web in-memory).
lib/src/auth/solid_auth_store.dart Introduces platform-aware OIDC store selection and legacy web secret purge helper.
lib/src/auth/solid_auth_session_store.dart Uses platform-aware store for session params (web in-memory).
lib/src/auth/solid_auth_manager.dart Calls legacy secret purge during login flow.
example/.metadata Updates Flutter project metadata (tooling revision/platform migration entries).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +90 to +93
await persistent.removeMany(
OidcStoreNamespace.secureTokens,
keys: _legacyWebSessionKeys,
);
Comment on lines +174 to +177
// On web, remove any DPoP private key / session parameters a previous
// persistent build may have left in localStorage. No-op on native.

await purgeLegacyWebSecrets();
Comment on lines +89 to +91
// Platform-aware store: persistent (OS-backed) on native, in-memory on web
// so the DPoP private key is never written to localStorage (see
// [createSolidAuthStore]).
Comment on lines +33 to 34
import 'package:solid_auth/src/auth/solid_auth_store.dart';
import 'package:solid_auth/src/auth/solid_oidc_config.dart';
@tonypioneer tonypioneer linked an issue Aug 12, 2026 that may be closed by this pull request
13 tasks
@tonypioneer
tonypioneer requested a review from cdawei August 12, 2026 00:56
@tonypioneer

Copy link
Copy Markdown
Collaborator Author

Close this PR for now, and will submit a new PR after fixing this issue by using sessionStorage to save the security key for the web app.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants