About Photon Suppor...
 
Notifications
Clear all

About Photon Support

2 Posts
2 Users
0 Reactions
1,076 Views
(@daftcube)
Posts: 5
Active Member
Topic starter
 

Could you please add Photon Cloud Authentication via Combu for Photon if you ever have time?

This is a more proper way to accept users into Photon via a login-system, atleast as far as I know. I'd love if you could add this if you ever have time.

 
Posted : 06/03/2015 1:54 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

It's really easy, accordingly to this thread the code for your custom Photon Cloud handler should be:

<?php
include './lib/api.php';

$username = filter_input(INPUT_GET, "username");
$password = filter_input(INPUT_GET, "password");

if (!$username || !$password) {

$login_info = array("ResultCode" => 3,"Message" => "Wrong data");

} else {

if (CB_Account::CheckLogin($username, $password)) {

$login_info = array("ResultCode" => 1,"Message" => "You are connected!");

} else {

$login_info = array("ResultCode" => 2,"Message" => "Wrong username or password");

}

}

Utils::EchoJson($login_info, TRUE);

Save it as login_photoncloud.php in your Combu folder and assign the proper URL in your Photon Cloud dashboard as described in the above thread.

N.B.: Of course you must still login with CBManager.Login using the same credentials that you pass to PhotonNetwork.AuthValues.AuthParameters in order to be authenticated in Combu.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 06/03/2015 4:07 pm
Share: