Enable DS Login with Client Credentials
Last updated on
Use the function below to enable DS login with client credentials.
- Unreal Engine
- Unity
FRegistry::ServerOauth2.LoginWithClientCredentials(FVoidHandler::CreateLambda([]()
{
// Do something if LoginWithClientCredentials has been successful
}), FErrorHandler::CreateLambda([](int32 ErrorCode, const FString& ErrorMessage)
{
// Do something if LoginWithClientCredentials has an error
UE_LOG(LogTemp, Log, TEXT("Error LoginWithClientCredentials, Error Code: %d Error Message: %s"), ErrorCode, *ErrorMessage);
}));
AccelByteServerPlugin.GetDedicatedServer().LoginWithClientCredentials(result =>
{
if (result.IsError)
{
// Do something if LoginWithClientCredentials has an error
Debug.Log($"Error LoginWithClientCredentials, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if LoginWithClientCredentials has been successful
}
});