Skip to main content

Windows

This article aims to introduce how to set up Steam authentication so that your game can use Player Network login and authentication services to log in via the Steam channel.

note

Players must install the Steam client on their device and log into their Steam account to log in to your Windows game using Steam.

Prerequisites

1. Configure Steam application on the official Steam website
1. Register Steamworks developer account
  1. Create a Steam account.

    When you first register as a Steamworks developer, you will need to complete a series of digital documents.One step involves paying the Steam Direct fee.You can pay using any Steam-supported payment method based on your country/region.

    The payment process will be completed in the Steam store, after which you will return to the Steamworks website to continue filling in other documents.For more information, refer to Preparing for Steamworks Registration.

  2. Log in to Steamworks.

    Image: Create application

2. Create Steam application
  1. After logging in to Steamworks, click View Dashboard on the main page to enter the Dashboard page.

    Image: Create application

  2. Make sure you have enough app credit (App Credit), then click Create new app....

    Image: Create application

  3. Refer to Steam Applications to fill in the basic information of your game.

    Image: Create application

  4. Click Create Now and confirm in the popup that the application has been created successfully.

3. Obtain App ID
  1. After successfully creating your application in Steamworks, click View All Apps on the Dashboard page.

    Image: Create application

  2. Click the application you created to enter its homepage.

    Image: Create application

  3. The App ID will be displayed next to the game title, such as "3461180" in the figure below.

    Each application has a unique ID, called the App ID.

    Image: Create application

4. Obtain Steam Web API Key
  1. After logging into Steamworks with an account with administrator permissions, click Users & Permissions > Manage Groups.

    Image: Steamworks application main page

  2. Select Everyone.

    Image: Select user group

  3. Under Edit group, click Create WebAPI Key to generate a key.

    Image: Create Steam WebAPI Key

  1. Enter the Player Network Console to create a new project for your game, or join an existing one.
  2. Download SDK.
  3. Integrate SDK.
  4. Add Steam as a login authentication method in Player Network Console.

Step 1: Configure SDK for Steam Login

note

During the game development stage, Steam account information, including STEAM_APPID, does not need to be configured in INTLConfig.ini.

1. Create steam_appid.txt file

During game development, if your game has not yet been approved for release in Steamworks Console, you need to create a steam_appid.txt file containing 480 and place it in the executable file directory.Generally, the directory is the Binaries/Win64/ folder of the game. If you're using Unreal Engine, place the file in the same directory as UE4Editor.exe (or UnrealEditor.exe), i.e., yourEnginePath/Engine/Binaries/Win64.

The contents of steam_appid.txt should only contain 480. There should be no other characters or blank lines.When the game is set to Coming Soon in Steamworks, please delete the steam_appid.txt file.

For more information, see Initialization and Shutdown in the Steamworks API Overview.

2. Select Steam login method

note

Player Network SDK V1.16 and later versions add support for logging in to Steam using INTLWebView.
Starting from Player Network SDK V1.21, logging in via system browser is supported.

  • If your game is going to be released on Steam, it is recommended to log in by connecting to the Steam client.Since Player Network SDK needs to call the Steam client for authentication, users must have the Steam application open and logged in before performing Player Network SDK authentication.
note

If logging in to your Steam account prompts "SteamAPI_Init failed. Please check your Steam client status", please check whether the Steam client has started and is logged in.

  • If your game is released on channels other than Steam, it is recommended to log in with INTLWebView or a system browser (supported in Player Network SDK V1.21 and later).When using INTLWebView or a system browser for Steam login, users do not need to open the Steam client.
caution

Using INTLWebView to log in to Steam in Editor mode on PC may cause crashes.This issue only occurs in Editor mode. It will not appear in the packaged PC version.

To enable INTLWebView or browser login for Steam, configure INTLConfig.ini as shown below:

# For INTLWebView login
STEAM_WEBVIEW_LOGIN_ENABLE = 1
# For system browser login
STEAM_BROWSER_LOGIN_ENABLE = 1
  • If both STEAM_WEBVIEW_LOGIN_ENABLE and STEAM_BROWSER_LOGIN_ENABLE are set to 1, only STEAM_WEBVIEW_LOGIN_ENABLE will take effect, INTLWebView will be used to log in to Steam.
  • If neither STEAM_WEBVIEW_LOGIN_ENABLE nor STEAM_BROWSER_LOGIN_ENABLE are set (or both are set to 0), Player Network SDK will connect to the Steam client for login.

Step 2: Add Steam Login

  1. Register login-related callbacks.

    // Add callbacks
    public void AddAuthObserver()
    {
    INTLAPI.AddAuthResultObserver(OnAuthResultEvent);
    }

    // Remove callbacks
    public void RemoveAuthObserver()
    {
    INTLAPI.RemoveAuthResultObserver(OnAuthResultEvent);
    }

    // Process the INTLAuthResult callback
    public void OnAuthResultEvent(INTLAuthResult ret)
    {
    Debug.Log($"MethodID: {ret.MethodId}");

    string methodTag = "";
    if (authRet.MethodId == (int)INTLMethodID. LOGIN)
    {
    methodTag = "Login";
    }
    else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_BIND)
    {
    methodTag = "Bind";
    }
    else if (authRet.MethodId == ( int)INTLMethodID.INTL_AUTH_AUTOLOGIN)
    {
    methodTag = "AutoLogin";
    }
    else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_QUERY_USER_INFO)
    {
    methodTag = "QueryUserInfo";
    }
    else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_GET_AUTH_RESULT)
    {
    methodTag = "GetAuthResult";
    }
    }
  2. Call the AutoLogin interface to log in automatically.

    INTLAPI.AutoLogin();
  3. If automatic login fails, call the Login interface to let the player log in manually.

    INTLAPI.Login(INTLChannel.Steam). 
  4. After logging in via Steam, fetch the avatar from ChannelInfo in the returned AuthResult.

    channelInfo : {"picture_path":"/path/to/image.png"}

    Set STEAM_AVATAR_RAW_RGBA_ENABLE to 1 in INTLConfig.ini to return RAW RGBA data.

    channelInfo : {"picture_path":"/path/to/image.json"}
  5. Synchronize client authentication status with the game backend and wait for the final verification result.

Step 3: Acceptance of login functionality

Search for the keyword "AuthResult" in the Player Network SDK logs to confirm whether the channel name and OpenID are returned correctly.If correct, it means the integration configuration is successful, and login functionality has been successfully added.

If you encounter problems during the integration process, please refer to Frequently Asked Questions.

Step 4: Release the game

For more information on releasing your game on the Steam platform, see the Steamworks Developer Program.

  1. Delete steam_appid.txt from the game's executable file directory, otherwise it may affect the game's login to the Steam platform.

  2. Modify Steam channel AppID in Player Network console to game's App ID, AppKey to Steam account's Steam Web API Key, then Player Network SDK will correctly initiate Steam login.

  3. [Optional] After downloading the SDK, modify configuration in the Player Network Console. Changes will not be synchronized to the INTLConfig.ini file.To ensure the game is launched from the Steam client, configure the STEAM_APPID field in INTLConfig.ini. For details, see SteamAPI_RestartAppIfNecessary.
    After configuring this field, start the game:

    • If the game is not started from the installed directory via Steam client, Steam-related initialization will fail.
    • If the Steam client is not launched, it will be started and directed to the corresponding game page.
    • If prompted with "Please launch app by Steam Client" at login, it means the game was not launched from the Steam client. You may delete the STEAM_APPID field and try again.
[Steam]
STEAM_APPID = {INTL_STEAM_APP_ID}

Replace {INTL_STEAM_APP_ID} with the Steam app ID you applied for for your service.