05-09-2023 09:40 PM
const verifyRequestPayload = {
access_token: `OC|${appId}|${appSecret}`,
nonce,
user_id: `${userId}`,
}
const response = await axios.post(`${oculusServerHost}/user_nonce_validate`, verifyRequestPayload)
'content-length': '190'
connection: 'close',
date: 'Tue, 09 May 2023 07:34:16 GMT',
'x-fb-debug': 'XXXXXXXXXXXXXXREDACTEDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==',
'x-fb-rev': '0000000000',
'x-fb-trace-id': 'XXREDACTEXX',
'x-fb-request-id': 'XXXXXREDACTEDXXXXXXXX',
expires: 'Sat, 01 Jan 2000 00:00:00 GMT',
'cache-control': 'no-store',
pragma: 'no-cache',
'strict-transport-security': 'max-age=31536000; preload; includeSubDomains',
'access-control-allow-origin': '*',
'oculus-api-version': 'v1.0',
'www-authenticate': 'OAuth "Facebook Platform" "invalid_request" "Parameter user_id: invalid user id: 9XXXXXXXXXXXXXXX"',
'content-type': 'application/json; charset=UTF-8',
vary: 'Origin',
(above are the response headers from meta; identifying information redacted for safety).
Solved! Go to Solution.
06-08-2023 12:02 PM - edited 06-20-2023 09:56 AM
Turns out this was a JSON parsing issue. For other devs that run into this, Meta's documentation suggests using a ulong for user ID's, but JSON serializing for S2S Rest API's would often corrupt the end of the ID. Hence, Oculus server's will return the verify request as "invalid" since it was missing the entirety of the ID. We solved this by serializing the ID as a string, and passed that via S2S instead, which reduced most of the "invalid" requests. More on this here:
https://jsoneditoronline.org/indepth/parse/why-does-json-parse-corrupt-large-numbers/
05-11-2023 04:17 PM
Wondering if there is a difference between using ovr_User_Get() vs. ovr_User_GetLoggedInUser() when it comes to verifying user ids with GetUserProof? The user verification documentation uses LoggedInUser but the v51 SDK Reference says to use Get, so I'm not sure why the redundancy or the difference between the two methods?
05-18-2023 11:33 AM
Ah, looks like Get is used for collecting info on users other than your own, whereas LoggedInUser is only for your own user account on the headset. Definitely looks like you're following the verification process exactly as outlined in the documentation. The invalid userid requests all falling into the same number range is definitely suspicious...
06-08-2023 12:02 PM - edited 06-20-2023 09:56 AM
Turns out this was a JSON parsing issue. For other devs that run into this, Meta's documentation suggests using a ulong for user ID's, but JSON serializing for S2S Rest API's would often corrupt the end of the ID. Hence, Oculus server's will return the verify request as "invalid" since it was missing the entirety of the ID. We solved this by serializing the ID as a string, and passed that via S2S instead, which reduced most of the "invalid" requests. More on this here:
https://jsoneditoronline.org/indepth/parse/why-does-json-parse-corrupt-large-numbers/
06-08-2023 12:24 PM
Thanks @thecodexter!