Windows
The purpose of this article is to describe how to set up Discord authentication so that your game can be logged in through the Discord channel using the Player Network login authentication service.
As the Discord SDK has stopped maintaining a license method for pulling up Discord Apps, there may be subsequent impacts on Discord App licensing.To ensure that Discord authorization is stable and available, it is recommended to use WebView for web authorization, see Configuring DISCORD_LOGIN_USING_WEB for details.
Prerequisites
1. Configuring the application on the Discord Developer Platform
1. Create Discord Application
Before creating a Discord application, register an account on the official Discord website and follow the prompts to complete account authentication (via email).
- Enter Discord Developer Platform.
When logging in for the first time, users may need to verify that they are not a robot.You can do this after email verification. - In the upper right corner of the Applications page, click New Application.

- In the application creation window that pops up, enter the application name and click Create.
- On the General Information page, view the APPLICATION ID.
The user must configure the App ID in the INTLConfig.ini file.

2. Configure Application
-
Go to Discord Developer Platform.
-
Click the application to configure on the Applications page.
-
Click OAuth2 in the left navigation bar and go to OAuth2 > General.
-
Configure the following redirect URLs under Redirects to receive callbacks after Discord authorization by clicking Add Another to add the cell:
- https://common-web.intlgame.com/jssdk/discordlogincallback.html
- https://test-common-web.intlgame.com/jssdk/discordlogincallback.html

For multi-store channel packs:
Support for multi-store channel packages requires a separate REDIRECT_URL_SCHEME.An App ID supports 10 redirect URLs (about 4 multi-store channel packs).If the game requires more than 4 multi-store channel packs, please request more App IDs.To use multiple application IDs, the game requires Configure multiple application IDs in INTLConfig.ini and Register multiple Discord applications on Player Network.
-
Click Rich Presence in the left navigation bar and enter Rich Presence Art Assets page.
-
Click Add Image(s) to configure the application's image resources.

All image resources used in the application must be configured on this page, including the cover photo for friend invitations.
- Obtain Player Network Console login account.
- Create a new project for your game, or join an existing one.
- Download SDK.
- Integrate the SDK.
- Add Discord as the login authentication method for the service in the Player Network console.
Step 1:Configure the SDK for Discord Login
Open your project's INTLConfig.ini file:
[INTL environment]
# WARNING: You should change this URL to the production environment when you release your game.
INTL_URL = https://test.intlgame.com
GAME_ID = {INTL_GAME_ID}
SDK_KEY = {INTL_SDK_KEY}
[INTL Log]
LOG_LEVEL = 1
LOG_CONSOLE_OUTPUT_ENABLE = 1
LOG_FILE_OUTPUT_ENABLE = 1
LOG_ENCRYPT_ENABLE = 0
LOG_COMPRESS_ENABLE = 0
[Discord]
DISCORD_APP_ID = {INTL_DISCORD_APP_ID}
DISCORD_REDIRECT_URL = {INTL_DISCORD_REDIRECT_URL}
- Set the SDK backend environment to
INTL_URL = https://test.intlgame.com. - Replace
{INTL_GAME_ID}and{INTL_SDK_KEY}with theGAME_IDandSDK_KEYvalues assigned by the Player Network console. - Set
LOG_LEVEL = 1,LOG_CONSOLE_OUTPUT_ENABLE = 1,LOG_FILE_OUTPUT_ENABLE = 1,LOG_ENCRYPT_ENABLE = 0andLOG_COMPRESS_ENABLE = 0to output console logs and log files without encrypting or compressing the output without encrypting or compressing the output. - Replace
{INTL_DISCORD_APP_ID}with the Discord App ID. - Replace
{INTL_DISCORD_REDIRECT_URL}with the Redirect URL configured on the Developer Platform.
Step 2:Add Discord Login
Discord does not require an application to be installed before logging in.If the app is installed, it will open the app login, otherwise it will open the web page login.
Discord login permission needs to add identify.If you need to integrate Discord sharing, add relationships.read,activities.write as well.
- Register login-related callbacks.
- Unity
- Unreal Engine
// 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.INTL_AUTH_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";
}
}
C++ Event Handling (above v1.15)
//configure callback
FINTLAuthEvent authEvent;
authEvent.AddUObject(this, &OnAuthResult_Implementation);
UINTLSDKAPI::SetAuthResultObserver(authEvent);
// Remove callbacks
UINTLSDKAPI::GetAuthResultObserver().Clear();
void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}
Unreal Event Handling
void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}
- Call the
AutoLogininterface to log in automatically.
- Unity
- Unreal Engine
INTLAPI.AutoLogin();
UINTLSDKAPI::AutoLogin();
- If automatic login fails, call the
Logininterface to let the player log in manually.
- Unity
- Unreal Engine
INTLAPI.Login(INTLChannel.Discord, "identify", "");
INTLAPI.Login(INTLChannel.Discord, "identify,relationships.read,activities.write", ""); //Friend functions
UINTLSDKAPI::Login(EINTLLoginChannel::Discord, "identify", "");
UINTLSDKAPI::Login(EINTLLoginChannel::Discord, "identify,relationships.read,activities.write", ""); //Friend functions
- Synchronize client authentication status with the game backend and wait for the final verification result.
Step 3: Acceptance testing for 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.