Auth laravel parse - mongodb

I have problem with login laravel parse. I use auth for connection and I use this library for to do parsehttps://github.com/sirthxalot/laravel-parse and the doc for tutorial https://laravel-parse.readthedocs.io/en/latest/fundamentals/object-model.html
if (Auth::attempt(['email' => $email, 'password' => $password])) {
echo "OK";
}else{
echo "Bad post";
}
After the post data, my result is "bad post"
please help me

Related

xmlrpc getting an error xmpp user register

I have working o ejabberd and xmpp but while register user i am getting an error
Notice: xmlrpc: Error -118 A problem '{error,access_rules_unauthorized}' occurred executing the command register with arguments
I am using this code
$request = xmlrpc_encode_request($command, $params, (array('encoding' => 'utf-8')));
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "User-Agent: XMLRPC::Client mod_xmlrpc\r\n" .
"Content-Type: text/xml\r\n" .
"Content-Length: " . strlen($request),
'content' => $request
)));
// echo '<pre>'; print_R($context); die;
$file = file_get_contents('http://192.168.1.22:4560/RPC2', false, $context);
//echo '<pre>'; print_R($file); die;
$response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
return $response;
}
I have tried everything but still getting an error.
So, you finally solved the previous problem you had in what else to do to enable XML-RPC in ejabberd? ? You can add an explanation there to help other people, or at least mark the problem as solved, so other people don't waste their time investigating something that you no longer care about.

Cannot fetch E-Mail from Facebook SDK

Cannot fetch E-Mail address from facebook SDK for some particular E-Mail accounts. The facebook account I am testing with do have their E-Mail address in facebook. I am having this issue for some particular accounts only. Is there any settings which I have to activate from facebook. To fetch E-Mail I am using PHP Facebook SDK, the code is listed below:
$fb = new Facebook\Facebook([
'app_id' => 'xxxxxxxxx',
'app_secret' => 'xxxxxxxxxxxxx',
'default_graph_version' => 'v2.11',
]);
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get('/me?locale=en_US&fields=id,name,email', $access_token);
} catch (Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch (Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$user = $response->getGraphUser();
echo '<pre>';
var_dump($user);
exit;
If I use artdarek/oauth-4-laravel I can fetch the E-Mail address for the exceptional cases as well. But as the project is live I cannot Install the same in live server. Please suggest an alternative way out with PHP Facebook SDK.

How to call soap api with BASIC authantication for WSDL URL

Blockquote
We are using Soap API but we can not connect to server.I am new in soap api.
We are using Code
username = testclient
password = tes#123
try {
$client=new SoapClient($wsdl,array('trace' => 1,"stream_context" => $context));
$result = $client->__call('getStatus', array());
} catch (Exception $e) {
echo $e->getMessage();
}
After passing header.
$client = new SoapClient(
'https://test/app/uat/test?wsdl',
array(
"exceptions" => 0,
"trace" => 1,
'stream_context' => stream_context_create(array(
'http' => array( 'header' => 'Authorization: Basic dGVzdGNsaWVudDp0ZXN0QDEyMw==' ),
)),
));
$result = $client->__soapCall('getBalance', array());
Also we have client and secret but How we can use for BASIC auth?
Where we can set user, pass and key and secret.
If you need any thing please let me know.
Thankyou

PHP - Post to Facebook Page using SDK no errors but no posts showing

I'm using the tutorial here http://www.adamboother.com/blog/automatically-posting-to-a-facebook-page-using-the-facebook-sdk-v5-for-php-facebook-api/ to post to a facebook page using the PHP sdk.
I have create the app on Facebook, and I have created the Never Expire Page Access Token, which I have verified using the Access Token Debug Tool https://developers.facebook.com/tools/debug/accesstoken/
However, when I run my test code, it does NOT return any errors, but I get no posts on my page. I get a response back from my print_r($graphNode) of the following
Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[id] => 1204777049583245_1264619360265680
)
)
The code for my test post is below, can anyone explain to me WHY I am not getting any posts to show up?
define("FACEBOOK_APP_ID","MY APP ID");
define("FACEBOOK_APP_SECRET","MY APP SECRET");
define("FACEBOOK_APP_TOKEN","MY PAGE ACCESS TOKEN");
define("FACEBOOK_SDK_V4_SRC_DIR",$_SERVER['DOCUMENT_ROOT'].'/socialmedia/Facebook/src/Facebook/');
require_once($_SERVER['DOCUMENT_ROOT'].'/socialmedia/Facebook/src/Facebook/autoload.php');
$fb = new Facebook\Facebook([
'app_id' => FACEBOOK_APP_ID,
'app_secret' => FACEBOOK_APP_SECRET,
'default_graph_version' => 'v2.2',
]);
//Post property to Facebook
$linkData = [
'link' => 'www.yoururl.com',
'message' => 'test message'
];
$pageAccessToken = FACEBOOK_APP_TOKEN;
try {
$response = $fb->post('/me/feed', $linkData, $pageAccessToken);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: '.$e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: '.$e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
echo '<pre>';
print_r($graphNode);
echo '</pre>';
exit;

SOAP Client Request --> Bad Request

I've been asked to look into syncing data using a SOAP service. I don't really know SOAP very well at all and I get a Bad Request Error.
The function I'm trying to call is a test echo function:
public string EchoAuthenticated(string text)
Each time I call it I get an error.
I have commented out the username / password setting as I don't know the username and password right now and my contact person is on leave :( Right now though I'd be perfectly happy just to get an authentication failed message rather than an error...
If anyone could point me in the right direction here please...
Thanks,
John
<?php
$apiUrl = 'https://exdev.api.propctrl.co.za/v3/Integration.svc?wsdl';
$options = array( 'trace' => 1, 'exceptions' => 1, 'soap_version' => SOAP_1_2);
try
{
$client = new SoapClient($apiUrl, $options);
//$data = array(
// 'Username' => "test",
// 'Password' => "test"
//);
//$header = new SoapHeader('https://exdev.api.propctrl.co.za/v3/', 'CredentialsHeader', $data, false);
//$client->__setSoapHeaders($header);
var_dump($client->__getFunctions());
print $client->EchoAuthenticated("Test String");
var_dump($client->__getLastRequest());
}
catch(Exception $e)
{
echo $e->getMessage();
}
?>
You might try something like:
...
$client = new SoapClient($apiUrl, $options);
var_dump($client->__getFunctions());
$auth = array("Username" => "John", "Password" => "secret",
"IsP24Credentials" => false);
$header = new SoapHeader("https://www.propctrl.com/", "CredentialsHeader",
$auth, FALSE);
$client->__setSoapHeaders($header);
print $client->EchoAuthenticated(array(
"text" => "My text to be echoed."
));
var_dump($client->__getLastRequest());
...
This should result in a request SOAP request like this:
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="https://www.propctrl.com/v3" xmlns:ns2="https://www.propctrl.com/">
<env:Header>
<ns2:CredentialsHeader>
<ns2:IsP24Credentials>false</ns2:IsP24Credentials>
<ns2:Password>secret</ns2:Password>
<ns2:Username>John</ns2:Username>
</ns2:CredentialsHeader>
</env:Header>
<env:Body>
<ns1:EchoAuthenticated>
<ns1:text>My text to be echoed.</ns1:text>
</ns1:EchoAuthenticated>
</env:Body>
</env:Envelope>
As a side note, you might have a look at http://www.soapui.org/. This tool helps greatly with web service development.