splatnet3_scraper.auth.NSO.g_token_generation_phase_2(web_service_access_token, na_id, coral_user_id, f_token_url)

Final phase of the gtoken generation process.

This is the second phase of the gtoken generation process. This is abstracted away into a separate method to allow the request to be retried once in the event of a failure. This phase involves two steps: first, the web_service_access_token is sent to the f_token_url in a request to obtain the f_token, which is a HMAC necessary to obtain the gtoken. The response contains three values: the f_token, the request_id, and the timestamp. These values are then sent to Nintendo’s servers along with the web_service_access_token to obtain the gtoken.

Parameters:
web_service_access_token : str

The Web Service Credential Access Token obtained from the first half of the gtoken generation process.

na_id : str

The Nintendo Account ID of the user. As of version 2.5.1, this is not used for anything. However, it is still required to futureproof in case Nintendo decides to enforce verification of this value.

coral_user_id : str

The Coral user ID of the user. This is used to verify the ftoken generation process. This is only required for step 2.

f_token_url : str

URL to use for f token generation. This package provides a default URL, but you can provide your own. The default URL is provided by imink.

Returns:

str – The gtoken from the response.