fix: force V1 auth when ecdhXprv is absent for addAccessToken - #9432
fix: force V1 auth when ecdhXprv is absent for addAccessToken#9432danielpeng1 wants to merge 1 commit into
Conversation
|
@claude review, and verify if this is the correct fix, given the changes from the past commit referenced in the PR description |
|
Claude finished @danielpeng1's task —— View job Code Review and VerificationI'll review this PR and verify if the fix correctly addresses the SSO access token issue. Todo List:
AnalysisThis PR correctly fixes a critical bug in SSO access token generation. Here's my detailed analysis: Problem ContextThe bug affected SSO users (Okta, Entra ID, etc.) who had ECDH keychains registered but no password (hence no Root Cause AnalysisThe previous condition was: if (!this._ecdhXprv && !strategyAuthenticated)This meant that when:
The condition evaluated to Fix Verification ✅The fix correctly reverts to: if (!this._ecdhXprv)This is the right approach because:
Code Quality AssessmentStrengths:
Test Coverage Analysis:
Security ConsiderationsThis fix does not introduce security concerns:
Recommendation✅ APPROVED - This is the correct fix. The logic is sound, the implementation is clean, and the test coverage is thorough. The fix properly addresses the specific SSO use case while maintaining backward compatibility and security. |
Problem
SSO users (Okta, Entra ID, etc.) were getting
undefinedwhen copying a newly created access token. This only affected SSO users whose account had an ECDH keychain registered, either because they originally signed up with a password, or had a support-initiated password reset.Root cause
Commit
c578250(ANT-963) changed the condition that tells the server "return the token in plaintext" from:to:
Browser users always have an active HMAC session, so the plaintext request was never sent. The server then encrypted the token with the user's ECDH key. SSO users have no password → no decryption key → token came back as
undefined.Fix
Revert to the original condition:
if (!this._ecdhXprv). HMAC request signing and ECDH response encryption are completely independent — whether the request is HMAC-signed has no bearing on whether the response token needs to be encrypted.Ticket: WCN-1790