Custom Auth parameters not being received by server

Hello, I have this code ,just to send user and pass (md5):
bool PhotonCloudListener::connectWithCustomServerAuth(const ExitGames::Common::JString& userName, const ExitGames::Common::JString& userID, const ExitGames::Common::JString& md5_password, const ExitGames::Common::JString& nameServerAddress)
{
  ExitGames::LoadBalancing::AuthenticationValues authValues = ExitGames::LoadBalancing::AuthenticationValues();
authValues.setUserID(userID);
  authValues.setType(ExitGames::LoadBalancing::CustomAuthenticationType::CUSTOM);
 JString params = "user=" + userID + "&pass=" + md5_password;
writeLog("AUTH PARAMS: " + params);
  authValues.setParameters(params);
  return m_photonCloudLoadBalancingClient->connect(authValues); //: userName, nameServerAddress);
}

and this is the server side:
$users = array(
	"demo1" => array("userid"=> "1001", "pass"=>md5("demo1")),
	"demo2" => array("userid"=> "1002", "pass"=>md5("demo2")),
	"demo3" => array("userid"=> "1003", "pass"=>md5("demo3"))
);
if(!isset($_GET["user"])|| !isset($_GET["pass"]))
{
	die( '{"ResultCode": 3,"Message":"error: user and pass are required to authenticate"}' );
}
$user = $_GET["user"];
$pass = $_GET["pass"];

if(!array_key_exists($user, $users) || $users[$user]["pass"]!=$pass)
{
	die(sprintf('{"ResultCode": 2, "Message":"Invalid user/pass combination : %s/%s"}',$user,$pass ));
}

die(sprintf(
	'{ "ResultCode": 1, "UserId": "%s"}',
	$users[$user]["userid"]
));

but I'm running into some problems here in the server, the user & pass is not being filled with the data I'm setting in the C++ code, so I wonder what's particurarly the problem.
The log from the game:

---
LogPhotonCloud: Display: Login in and Connecting with Custom Auth Server..., username: demo1 , userid: demo1, password: e368b9938746fa090d6afd3628355133
LogPhotonCloud: <PhotonCloud>: AUTH PARAMS: user=demo1&pass=e368b9938746fa090d6afd3628355133
LogBlueprintUserMessages: [ConnectWidget_BP_C_0] 0==0
LogPhotonCloud: <PhotonCloud>: ERROR: 2019-12-19 11:23:30,488 ERROR Client.cpp ExitGames::LoadBalancing::Client::onOperationResponse() 1613 OperationResponse - operationCode: 230, returnCode: 32755 (Invalid user/pass combination : demo/demo/)
LogPhotonCloud: <PhotonCloud>: ERROR: 2019-12-19 11:23:30,489 ERROR Client.cpp ExitGames::LoadBalancing::Client::onOperationResponse() 1627 OperationResponse - operationCode: 230, returnCode: 32755 (Invalid user/pass combination + token: demo/demo/) {}
LogPhotonCloud: <PhotonCloud>: ERROR: 2019-12-19 11:23:30,489 ERROR Client.cpp ExitGames::LoadBalancing::Client::onOperationResponse() 1630 authentication failed with errorcode 32755: Invalid user/pass combination + token: demo/demo/
LogBlueprintUserMessages: [PhotonCloudAPI_BP] Disconnecting
LogPhotonCloud: <PhotonCloud>: Warn: connect failed 32755 Invalid user/pass combination: demo/demo
LogBlueprintUserMessages: [PhotonCloudAPI_BP] Peer Created
LogPhotonCloud: <PhotonCloud>: disconnected
---
demo is the default value of the optional key/value pair from the dashboard in the photon app web.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    hi @juaxix,

    Thank you for choosing Photon!

    From the documentation:
    The default HTTP method used in authentication is GET. So, parameters can be sent as key/value pairs in the query string. The final URL will include the "union" of the key/value pairs set from client and those set from the dashboard. In case, the same key is used in both places, only the dashboard value will be sent.

    Since the dashboard has "user":"demo" and "pass": "demo" key/values then those will overwrite what the client sends.
  • JohnTube wrote: »
    Since the dashboard has "user":"demo" and "pass": "demo" key/values then those will overwrite what the client sends.

    removing these key/values from the dashboard config resolved the problem, many thanks!