Need help with authenticating using custom server.
Options
Hello.
I've read up this this thread, and got the basic idea of how to work on the server side. I already set up the PHP code to check if the e-mail match the password.
However I can't figure out how to make the client authenticate it successfully. On the server side the authenticate work OK -- tested by typing in the url, www.mydomain.com/unity_login.php?email=myemail&passwd=mypasswd gives the json output of { "ResultCode": 1, "Message": "You've logged in"}, which is true since in my MySQL database a user with myemail have a the password mypasswd. But what do I do with the json output? On the linked thread above, what it only does it echo it json string out.
Another problem I'm having is on the client side.
On my client side, in my network manager I got:
Is this the correct way? Can someone provide some insight? I've tried to do this for hours but still couldn't manage to get it to work.
Thank you in advance, gents and ladies.
I've read up this this thread, and got the basic idea of how to work on the server side. I already set up the PHP code to check if the e-mail match the password.
However I can't figure out how to make the client authenticate it successfully. On the server side the authenticate work OK -- tested by typing in the url, www.mydomain.com/unity_login.php?email=myemail&passwd=mypasswd gives the json output of { "ResultCode": 1, "Message": "You've logged in"}, which is true since in my MySQL database a user with myemail have a the password mypasswd. But what do I do with the json output? On the linked thread above, what it only does it echo it json string out.
Another problem I'm having is on the client side.
On my client side, in my network manager I got:
PhotonNetwork.AuthValues = new AuthenticationValues ();
PhotonNetwork.AuthValues.AuthType = CustomAuthenticationType.Custom;
string getParams = "email=" + email + "&password=" + password;
PhotonNetwork.AuthValues.AuthGetParameters = getParams;
PhotonNetwork.ConnectUsingSettings ("1.0");
Is this the correct way? Can someone provide some insight? I've tried to do this for hours but still couldn't manage to get it to work.
Thank you in advance, gents and ladies.
0
Best Answer
-
OHHH OKAY.
I understand the concept now. I just need to echo the json object. I was a fool to put other echos in the same file, which make the unity unable to read it as a json object.
Beginner's mistake. Forgive me. Can't believe solution this simple take me hours to solve.5
Answers
-
OHHH OKAY.
I understand the concept now. I just need to echo the json object. I was a fool to put other echos in the same file, which make the unity unable to read it as a json object.
Beginner's mistake. Forgive me. Can't believe solution this simple take me hours to solve.5