feat(libSceNpAuth): implement sceNpAuthGetAuthorizationCodeA and sceNpAuthGetIdTokenA #8471
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8471"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by NoOverflow on 2026-10-20T13:12:44Z.
What
Implements
sceNpAuthGetAuthorizationCodeAandsceNpAuthGetIdTokenAincore/libs/prx/libSceNpAuth/Export.cpp:paramor output returnsORBIS_NP_AUTH_ERROR_INVALID_ARGUMENT(0x80550301), an unknown request ID returnsORBIS_NP_AUTH_ERROR_REQUEST_NOT_FOUND(0x80550306), an aborted request returnsORBIS_NP_AUTH_ERROR_ABORTED(0x80550304), a sync request fails immediately withSCE_NP_ERROR_SIGNED_OUTand an async one defers it to Poll/Wait.issuer_idstays optional, as in the V3 call.core/libs/tests/GuestNpAuth.cppcovering argument validation, the sync and async signed-out flows, unknown request IDs and aborted requests for both calls.docs/dev/debt/libSceNpAuth.md; the signatures are still not measured on a console.libSceNpAuthexports (14/14, 100.0%).Tested
cmake --build build --target libSceNpAuth guest_np_auth_tests guest_np_auth_authorized_app_code_tests guest_np_auth_authorized_app_dialog_testsbuilt cleanly;ctest --test-dir build -R np_auth --output-on-failurepassed (3/3: guest_np_auth, guest_np_auth_authorized_app_code, guest_np_auth_authorized_app_dialog).python3 tools/check_conventions.py --base origin/main: passed with 0 violations.python3 tools/pr_overlap.py --branch feat/libSceNpAuth-a-variants: no shared exports or conflicting lines; the uncompared shared files belong to PR 6044 (test reorganization) and PR 6977 (appends a no-argumentsceNpAuthGetAuthorizationCodestub on a stale base), which implement neither function.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T13:33:32Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/tests/GuestNpAuth.cppcore/libs/prx/libSceNpAuth/Export.cppcore/libs/prx/libSceNpAuth/Export.cppcore/libs/tests/GuestNpAuth.cppdocs/dev/debt/libSceNpAuth.mdImported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T19:05:12Z.
docs/dev/debt/libSceNpAuth.md#L6: the merged entry has only one shadPS4 link,
https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_auth.cpp, and it returns 404. shadPS4#5390 moved the file tonp/np_auth/np_auth.cppon 2026-10-19. This PR deletes the two entries whose shadPS4 links still work. As a result, nobody can check the new clause "the A calls forward to their V3 counterparts, which share one implementation in shadPS4" from the entry.I'd pin the link to the last version at the old path, db126323. That is the file the link showed when the entry was written, and the A and V3 calls share one helper there too (L170-L180, L266-L274). The longer URL takes the entry from 969 to 1005 characters, which is over the 1000-character
debt-lengthwarning intools/check_conventions.py. With this wording the entry is 997 characters:Line 7 (
sceNpAuthSetTimeout) has the same dead link. Pinning it to db126323 also keeps its "which only stubs it" true (L276-L280). The rewritten file checks the timeouts and the request ID (L201-L224), so it no longer backs that sentence.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T02:56:47Z.
@NoOverflow the forwards and tests look good. Two small things before merge:
docs/dev/debt/libSceNpAuth.mdentry 404s since shadPS4#5390 moved the file tosrc/core/libraries/np/np_auth/np_auth.cpp. Please point it at the new path, ideally pinned to a commit, so the "A calls forward to V3" statement can be checked.return sceNpAuth...V3(...)lines are indented by one space; the rest ofExport.cppuses four.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T04:47:56Z.
Independent Windows run of this PR (data only).
Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against
mainis clean. I built onlyguest_np_auth_tests;ctest -N -R guest_np_authlists exactly one test.Results (3 runs each):
guest_np_authpasses 3/3.core/libs/prx/libSceNpAuth/Export.cppwith the version from the PR's merge base (44e3389c88), then rebuilt. The test fails 3/3 (exit 0xc0000409). I restored the PR's files afterwards.Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T11:28:35Z.
Progress report (
3e91c8e→488da17)📈 System libraries: 48.8% (+0.02%, +2 implemented functions)
✅ 2 implemented
sceNpAuthGetAuthorizationCodeAsceNpAuthGetIdTokenAImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T13:53:08Z.
Thanks, @oneandonlydean and @nikowolf123. Both points are done as a commit on the branch:
return sceNpAuth...V3(...)lines inExport.cppare indented with four spaces.docs/dev/debt/libSceNpAuth.mdnow links shadPS4 atf68923fe, undernp/np_auth/np_auth.cpp, with line ranges for the A and V3 variants of both calls. They call the same helper and differ only in a version flag.Checked the forwards against shadPS4, the tests (they fail on the old throwing stubs, as @xXPBSXx's Windows run shows) and the scoped ctest; merged.