splatnet3_scraper.auth.NSO.g_token_generation_phase_1(id_token, user_info, na_id, f_token_url)

First phase of the gtoken generation process.

This is the first 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 id_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 id_token to obtain the gtoken.

Parameters:
id_token : str

ID token from user access token response. This is obtained from the user access token response, and is used to identify the user to Nintendo’s servers. However, this cannot be used to identify the user by a third party by itself.

user_info : dict[str, str]

The dictionary of user info returned by get_user_info. This must contain the keys language, birthday, and country.

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.

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 Web Service Credential Access Token.

  • str – The Coral user ID.