Parameter Storage
Before making a query to the NSO servers, the API first needs to generate a Gameweb Token (gToken) and service-specific parameters.
The gToken and parameters have unique lifetimes of usually around 2-3 hours, so the API stores them in a key-value pair in order to debounce them correctly.
No personal information is ever stored. Every entry is automatically deleted after 24 hours.
Storage Process
Storage Key
The API will take the session token and hash it using SHA256 to create a unique key for the key-value pair.
As an example, we will use this (invalid) session token:
So the hashed key would be:
Hashed values are not reversible. It is impossible to retrieve the original session token from the hashed key.
Storage Value
Using the session token, the API generates the necessary gToken and parameters for the service you want to query and encrypts them before storing them in the key-value pair.
As an example, we will make a query to Splatnet 3. The resulting gToken and parameters are:
The gToken and service parameters are now encoded into Uint8Arrays:
Now the session token is also encoded, and the first 32 values are extracted from the resulting Uint8Array:
Finally, we will use those 32 values to create a CryptoKey to encrypt the Uint8Arrays of the gToken and parameters. The resulting ArrayBuffers are then encoded into strings:
When a request is made to the API, the session token is used to decrypt the value and retrieve the gToken and parameters so it can perform the queries.
Since the value was encrypted using the session token, it is impossible to read the value without it.
Service Parameter List
Every service has unique parameters that are generated and stored:
-
Splatnet 3
gToken
bulletToken
lang
is_noe_country
-
Coral
accessToken