Kohana - Facebook app URL - kohana

I'm developing my first facebook app on kohana 2.3.x at the moment and I noticed that a usual app url should look like this:
http://apps.facebook.com/{my_app}/{controller}/{method}
But in my app it shows the real url.
http://mydomain.com/{controller}/{method}
Any idea how to fix that in Kohana?
Thanks in advance!

Try changing this in application/config/config.php:
$config['site_domain'] = 'apps.facebook.com/my_app/';

Related

How to get URL of shop in Shopify embeded app?

I'm building a Shopify App using this template: https://github.com/Shopify/shopify-app-template-node/tree/cli_three and I was wondering how I'm able to get the URL of the shop that is using my app (means the URL of the document outside the iFrame). I had a working approach using location.ancestorOrigins (https://developer.mozilla.org/en-US/docs/Web/API/Location/ancestorOrigins), but since this is not compatible with Firefox, I was wondering if there is another approach. Thanks in advance for your help!
Okay, so I came up with a solution by myself, but thanks for your help #TwistedOwl and #David Lazar. I post my code here in case anyone has the same problem in the future:
import {useAppBridge} from "#shopify/app-bridge-react";
function DemoPage() {
const bridge = useAppBridge();
const shopUrl = bridge.hostOrigin.replace('https://', '').replace('www.', '');
console.log(shopUrl);
}
All calls to your App provide a shop parameter (and now a host parameter too) ensuring you always know the shopify store using your App. There are zero situations where your App is called without the shop parameter being part of the equation from Shopify.

Codeigniter Controller class login form : 404 page not found

Im trying to combine several tutorials about Codeigniter and bootstrap and understand per codes so i can integrate it in my project. What i am trying to do right now is create a login form using the two framework.
And i setup my View according to the turotial included in Codeigniter 'user_guide/tutorial/static_pages.html' which my landing page is named as 'home.php' is inside the folder 'pages' and header.php, and footer.php is inside the 'templates' folder. I created also a controller: Page.php.
I also use .htaccess to hide 'index.php'. Now i follow this tutorial how to create a login page:
http://learnjquerybootstrap.blogspot.com/2015/01/login-session-using-codeigniter-and-bootstrap.html?m=1
-the only difference is this since i use htaccess:
<?php echo form_open(clogin/index); ?>
But when I try to submit the page i receive a: 404 page not found.
My navbar links are working fine. I understand that the codeigniter works like this:
http://localhost/myfolder/index.php/class/function/
so when i submit my form the url that show up is:
http://localhost/myfolder/clogin/index
and gives me: 404 page not found.
Question:
What is wrong with it?
is there something wrong with the tutorial that i am using? i check other tutorials and the controller structure is just the same, like on this link:
http://www.kodingmadesimple.com/2014/08/how-to-create-login-form-codeigniter-mysql-twitter-bootstrap.html
do i need to include clogin.php in route.php?
or is it about the htaccess? my
uri_protocol
is configured as
'REQUEST_URI'
in config.php. i tried other options but still the same.
Don't need include to route.
I recommented ready auth library.
If you use DevTools in your browser maybe "Network" tab of devtools can help you to why you get 404 error.
i already firgured it out.The mistake was in the route.php, since i tried to combine two examples.. i realized that the wildcard route that i included from the Codeigniter user guide will not work with the Clogin.php.
Since it was set as
$route['(:any)']='pages/view/$1';
So the url works as
http://localhost/myfolder/pages/view/clogin
instead of
http://localhost/myfolder/clogin.
I removed it and now it is working.

Nest Javascript Thermostat sample not working - 400 Bad Request

I've built the sample app from here: https://developer.nest.com/documentation/cloud/control/
I've created a Client configuration on the developer site with the callback url http://localhost:8080.
The app loads and brings you to the Nest login screen. After entering details it should redirect back but instead the URL https://home.nest.com/session fails with a 400 Bad Request and the response:
{"error":"invalid_request","error_description":"missing user credentials"}
Has anyone got this sample working lately? I believe it's failing in the server.js file at this line (but I'm no Node expert unfortunately):
app.get('/auth/nest', passport.authenticate('nest'));
I've replaced the firebase.js file with the version from the Nest site. Could this be a bug in a recent version of Express or the Nest Passport library?
Tried on OSX, Linux and Windows and getting the same issue.
Thanks!
The OAuth Redirect URI in your client for this example should be http://localhost:8080/auth/nest/callback and be sure that your permissions are set for Thermostat read/write.

Why is Facebook throwing an error when I edit App Domains?

I registered a .cc domain name (www.kreative.cc). But when I type "kreative.cc" in the App Domains field in the application manager I got an error
Erro There was a problem saving your changes. Please try again later.
I did test other urls and they're all right.
I've been trying for a couple of days. What can I do?
you can use the facebook graph api to write your app settings, seems that facebook is not validating the input this way. here is a simple example in php:
<?php
include 'Zend/Http/Client.php';
$http = new Zend_Http_Client('https://graph.facebook.com/MY_APP_ID');
$http->setMethod('POST');
$http->setParameterPost(array(
'access_token' => 'MY_APP_ACCESS_TOKEN',
'app_domains' => array('mydomain.cc'),
'website_url' => 'http://mydomain.cc',
'page_tab_url' => 'http://mydomain.cc',
'secure_page_tab_url' => 'https://mydomain.cc',
));
$response = $http->request()->getBody();
Try leaving the Apps Domain field empty while filling up the rest of the fields - be it Page Tab of Facebook App. That worked for me.
I have the same problem. I`m following the Developers Bug Report http://developers.facebook.com/bugs/130468767129410
If you fill App Domain Name with the site IP you'll got success. Ex: http://50.23.134.34 instead of http://www.kreative.cc.

web site scraping through Jsoup

I have spent few hours on signing in to web site by using jsoup. But it always gives same login page. To clarify the issue I tried with facebook site. It also gives same result.
Below I mentioned my code
String url ="http://www.facebook.com/";
Document doc;
doc = Jsoup.connect(url)
.data("email","abc#gmail.com","pass","xyz")
.userAgent("Mozilla").post();
System.out.println(doc);
can anybody point me where I made a mistake and how can i fix this issue?
In data portion "email" and "pass" are input field id of facebook login page.
Thank you.
Try this:
String url ="http://www.facebook.com/";
Document doc;
doc = Jsoup.connect(url)
.data("email","abc#gmail.com")
.data("pass","xyz")
.userAgent("Mozilla")
.post();
Anyway, Jsoup is not bad at all, you only need how to use it properly, but also you need to keep in mind that Facebook is expecting a lot more parameters to make a successfull login via POST emulating a web page navigation.
By example:
charset_test
default_persistent
lgnjs
lgnrnd
locale
lsd
pass
persistent
timezone
If you need to authenticate and get proper data I suggest that you must give a try to a Facebook SDK for Android:
https://github.com/facebook/facebook-android-sdk/

Resources