Commit 1dad5b3
committed
fix(dpop): gate proof attachment on per-credential state
DPoP proof attachment was gated by the process-wide
`SalesforceSDKManager.isUseDPoP()` flag. When the flag was flipped off while a
DPoP-bound credential was still in use, subsequent refresh calls and REST /
identity requests silently dropped the proof, producing a 401 loop.
Gate on `tokenType == "DPoP"` OR `DPoPKeyManager.hasKeyPair(alias)` instead.
The global flag continues to govern new logins only; once a credential is
bound, every request for it carries a proof regardless of flag state.
- DPoPKeyManager: add `hasKeyPair(alias)` side-effect-free presence check;
add `shouldAttachDPoP(alias, tokenType)` belt-and-suspenders predicate.
- OAuth2: widen `refreshAuthToken` with `tokenType`; replace flag guards at
refresh, use_dpop_nonce retry, and identity-service paths with the new
predicate.
- RestClient / ClientManager / AuthenticatorService: thread `tokenType`
through so the outbound-API guard honors bound credentials.
- Tests: OAuth2DPoPTest + RestClientDPoPGateTests unit coverage;
DPoPKeyManagerTest coverage for the presence check; AuthFlowTester UI test
locks in the flag-off-then-refresh behavior.1 parent 6bc2d07 commit 1dad5b3
10 files changed
Lines changed: 680 additions & 15 deletions
File tree
- libs
- SalesforceSDK/src/com/salesforce/androidsdk
- auth
- dpop
- rest
- test/SalesforceSDKTest/src/com/salesforce/androidsdk
- auth
- dpop
- rest
- native/NativeSampleApps/AuthFlowTester/src/androidTest/java/com/salesforce/samples/authflowtester
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
Lines changed: 49 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
| 500 | + | |
| 501 | + | |
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
| |||
515 | 516 | | |
516 | 517 | | |
517 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
518 | 547 | | |
519 | 548 | | |
520 | 549 | | |
| |||
530 | 559 | | |
531 | 560 | | |
532 | 561 | | |
533 | | - | |
| 562 | + | |
534 | 563 | | |
535 | 564 | | |
536 | 565 | | |
| |||
619 | 648 | | |
620 | 649 | | |
621 | 650 | | |
622 | | - | |
| 651 | + | |
623 | 652 | | |
624 | 653 | | |
625 | 654 | | |
| |||
671 | 700 | | |
672 | 701 | | |
673 | 702 | | |
674 | | - | |
| 703 | + | |
675 | 704 | | |
676 | 705 | | |
677 | 706 | | |
| |||
682 | 711 | | |
683 | 712 | | |
684 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
685 | 726 | | |
686 | 727 | | |
687 | 728 | | |
| |||
703 | 744 | | |
704 | 745 | | |
705 | 746 | | |
| 747 | + | |
706 | 748 | | |
707 | | - | |
| 749 | + | |
708 | 750 | | |
709 | 751 | | |
710 | 752 | | |
| |||
721 | 763 | | |
722 | 764 | | |
723 | 765 | | |
724 | | - | |
| 766 | + | |
725 | 767 | | |
726 | 768 | | |
727 | 769 | | |
728 | 770 | | |
729 | 771 | | |
730 | 772 | | |
731 | 773 | | |
732 | | - | |
733 | | - | |
| 774 | + | |
734 | 775 | | |
735 | 776 | | |
736 | 777 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
72 | 107 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | | - | |
| 785 | + | |
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
915 | 915 | | |
916 | 916 | | |
917 | 917 | | |
918 | | - | |
919 | | - | |
920 | | - | |
| 918 | + | |
921 | 919 | | |
922 | 920 | | |
923 | 921 | | |
| |||
0 commit comments