SecurityToken
SecurityToken
#Overview
name: SecurityToken
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files. Also referenced in 2
C# build files meaning it may affect the build system logic.
#Summary
#Usage in the C++ source code
The purpose of SecurityToken is to provide an optional security measure for the Android File Server plugin in Unreal Engine 5. It serves as an authentication token required to start the FileServer, enhancing the security of file operations between the development environment and Android devices.
This setting variable is primarily used by the Android File Server plugin, which is part of the Runtime plugins in Unreal Engine 5. It is specifically referenced in the AndroidFileServerEditor module.
The value of this variable is initially set to “[AUTO]” in the constructor of UAndroidFileServerRuntimeSettings. If left as “[AUTO]”, it is automatically generated as a unique GUID string in the PostInitProperties() function. Developers can also manually set this value through the project settings.
The SecurityToken interacts with other variables in the UAndroidFileServerRuntimeSettings class, such as bEnablePlugin and bIncludeInShipping. These variables collectively control the behavior and packaging of the Android File Server plugin.
Developers must be aware that:
- Leaving the SecurityToken empty disables this security feature.
- The token is automatically generated if not manually set.
- It’s part of the config properties, meaning it can be adjusted in the project settings.
Best practices when using this variable include:
- Regularly updating the SecurityToken to maintain security.
- Ensuring that the token is securely shared with team members who need access to the FileServer.
- Considering whether to include the FileServer in shipping builds (controlled by bIncludeInShipping) and adjusting the SecurityToken accordingly.
- Documenting the current SecurityToken in a secure location accessible to the development team.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:369, section: [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
- INI Section:
/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings
- Raw value:
1E34FAD14FB6811576827AA0EEB85D69
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServerEditor/Private/AndroidFileServerRuntimeSettings.cpp:11
Scope (from outer to inner):
file
function UAndroidFileServerRuntimeSettings::UAndroidFileServerRuntimeSettings
Source code excerpt:
, bEnablePlugin(true)
, bAllowNetworkConnection(true)
, SecurityToken(TEXT("[AUTO]"))
, bIncludeInShipping(false)
, bAllowExternalStartInShipping(false)
, bCompileAFSProject(false)
, bUseCompression(false)
, bLogFiles(false)
, bReportStats(false)
#Loc: <Workspace>/Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServerEditor/Private/AndroidFileServerRuntimeSettings.cpp:29
Scope (from outer to inner):
file
function void UAndroidFileServerRuntimeSettings::PostInitProperties
Source code excerpt:
// Auto-generate a security token first time
if (SecurityToken == "[AUTO]")
{
FGuid UniqueId = FGuid::NewGuid();
SecurityToken = UniqueId.ToString();
TryUpdateDefaultConfigFile(TEXT(""), false);
}
}
#Loc: <Workspace>/Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServerEditor/Public/AndroidFileServerRuntimeSettings.h:35
Scope (from outer to inner):
file
class class UAndroidFileServerRuntimeSettings : public UObject
Source code excerpt:
// Optional security token required to start FileServer (leave empty to disable)
UPROPERTY(EditAnywhere, config, Category = Packaging, Meta = (EditCondition = "bEnablePlugin"))
FString SecurityToken;
// Embed FileServer in Shipping builds
UPROPERTY(EditAnywhere, config, Category = Packaging, Meta=(EditCondition = "bEnablePlugin"))
bool bIncludeInShipping;
// Allow FileServer to be started in Shipping builds with UnrealAndroidFileTool
#References in C# build files
This variable is referenced in the following C# build files:
Location: <Workspace>/Engine/Source/Programs/AutomationTool/Android/AndroidPlatform.Automation.cs:834
bEnablePlugin = true;
}
if (!Ini.GetString("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "SecurityToken", out AFSToken))
{
AFSToken = "";
}
if (!Ini.GetBool("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "bIncludeInShipping", out bIncludeInShipping))
{
bIncludeInShipping = false;
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs:4954
}
Ini.GetString("/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings", "SecurityToken", out string AFSToken);
AFSToken = string.IsNullOrEmpty(AFSToken) ? "" : " -k " + AFSToken;
string AFSExecutable = Path.Combine(Unreal.EngineDirectory.ToString(), @"Binaries/DotNET/Android/UnrealAndroidFileTool", GetAFSExecutable(UnrealTargetPlatform.Win64, Logger));
string AFSArguments = $"-p {PackageName}{AFSToken}";