Skip to content

[PM-4439] Replace oidc-client-ts with oauth4webapi#20824

Open
harr1424 wants to merge 5 commits into
mainfrom
PM-4439-Tech-Debt-Vet-usefulness-and-potential-risk-of-including-Oidc-client-as-a-dependency
Open

[PM-4439] Replace oidc-client-ts with oauth4webapi#20824
harr1424 wants to merge 5 commits into
mainfrom
PM-4439-Tech-Debt-Vet-usefulness-and-potential-risk-of-including-Oidc-client-as-a-dependency

Conversation

@harr1424

@harr1424 harr1424 commented May 22, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-4439

📔 Objective

Much of the functionality provided by oidc-client-ts was not being used, and has been replaced with oauth4webapi which is better scoped to the functionality we depend upon.

AppSec dependency review

@harr1424 harr1424 changed the title initial dep swap [PM-4439] Replace oidc-client-ts with oauth4webapi May 22, 2026
@codecov

codecov Bot commented May 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.45%. Comparing base (30f00be) to head (4293581).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ponents/lastpass/lastpass-direct-import.service.ts 94.44% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20824      +/-   ##
==========================================
+ Coverage   49.32%   49.45%   +0.13%     
==========================================
  Files        4096     4096              
  Lines      128872   128890      +18     
  Branches    19780    19741      -39     
==========================================
+ Hits        63563    63743     +180     
+ Misses      60597    60434     -163     
- Partials     4712     4713       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@harr1424 harr1424 marked this pull request as ready for review June 17, 2026 13:56
@harr1424 harr1424 requested review from a team as code owners June 17, 2026 13:56
@harr1424 harr1424 requested a review from dereknance June 17, 2026 13:56
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the replacement of oidc-client-ts with oauth4webapi in the LastPass federated (OIDC) direct-import flow. The new implementation correctly preserves the security properties of the authorization-code flow: PKCE (S256), state validation via validateAuthResponse (CSRF), nonce validation via expectedNonce + requireIdToken (replay), and userinfo subject validation against the ID token sub. The removed dependencies (oidc-client-ts, transitive crypto-js and jwt-decode) have no remaining code references, the dropped passwordGenerationService constructor param is resolved automatically by providedIn: "root" DI, and AppSec dependency review (VULN-591) is referenced. New unit tests cover request building and response processing including the error paths.

Code Review Details

No blocking findings.

Note: libs/importer/jest.config.js switches the importer test suite from the plain ts-jest shared config to jest.config.angular (jest-preset-angular). This drops the documented CI memory-leak mitigations from the old config (isolatedModules: true, maxWorkers: 3 per EC-497) for all importer tests. The Angular preset is appropriate given the suite now exercises Angular code, and CI passes — flagging only for awareness.

Dependency Changes

Package Change Ecosystem
oauth4webapi New (3.8.6) npm
oidc-client-ts Removed npm
crypto-js Removed (transitive) npm
jwt-decode Removed (transitive) npm

@dereknance dereknance 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.

✅ Platform

@harr1424 harr1424 added the needs-qa Marks a PR as requiring QA approval label Jun 18, 2026
@harr1424 harr1424 added the t:tech-debt Change Type - Tech debt label Jun 26, 2026
…al-risk-of-including-Oidc-client-as-a-dependency
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

needs-qa Marks a PR as requiring QA approval t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants