Welcome Guest, Not a member yet? Register   Sign In
Tank Auth with Facebook Connect Authentication
#1

[eluser]ericbae[/eluser]
Hello all,

As my first CI and GitHub project, I posted up a Tank Auth authentication system integrated with Facebook Connect (or is it called Open Graph now?) Authentication mechanism.

I'm pretty sure there are others who've tried it, but last time I did a search, there wasn't any plug-in you could download and use straight away. Anyway, here's the link to the project.

https://github.com/ericbae/Tank-Auth---3...on-Project

I put up a short WIKI page on GitHub page as well, so I'm hoping it will make sense to those who want to use it. Right now it's only supporting Facebook, but I'll try to integrate Twitter and others as well.

Enjoy.
#2

[eluser]pabloheim[/eluser]
hi, i've benn testing and seems to be great. very simple and clean

now, how would you adapt it to make some changes in facebook from the local app,? for instance, after an user makes an action, submit a message to his wall
#3

[eluser]ericbae[/eluser]
Hey pabloheim!

Thanks for checking it out. With Facebook Open Graph, there are a lot of things you can do using the API and I've tried some of its features and certainly not all of them.

I'll try to implement some of these things in the future, but for now, to directly answer your question on "how to submit a message on your Facebook wall", first you'll need to know the "permission parameter" that lets you do this. (for a more comprehensive list, you'll probably need to read the API reference developers.facebook.com/docs/reference/api/)

A particular parameter you are looking for is "publish_stream" permission. You need to set this up on the Facebook connect button code.

In the "login_form.php" file, look for "<fb:login-button..." and there should be an attribute called "perms", which currently has nothing. In this, you'll need to put perms="publish_stream". Once you do this, when you connect using Facebook, it'll confirm whether you really want to do this.

Once you've done that, you can do the following

$url = "https://graph.facebook.com/FACEBOOK_USER_ID/feed"
$attachment = array("access_token" => get the access token, "name"=>"hello world", "link"=>"http://myapp.com", "description"=>"My first post to Facebook wall");

You now have the URL and the data that you are going to post to your wall. You can then use CURL to post this. Hope that helps!
#4

[eluser]VojkoZ[/eluser]
What is wrong?

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: D:\@xampp\htdocs\code\system\database\DB_driver.php

Line Number: 124

Using XAMPP server.
#5

[eluser]pabloheim[/eluser]
[quote author="VojkoZ" date="1300925195"]What is wrong?

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: D:\@xampp\htdocs\code\system\database\DB_driver.php

Line Number: 124

Using XAMPP server.[/quote]

did you change the parameters in the config/database.php ?
#6

[eluser]pabloheim[/eluser]
hi eric

testing your code , i think i have found a little bug.
the process of login works fine, but when i logout and then try to log in again (without closing the current window) it logged me in automatically with the previous account, it doesnt ask facebook. so, it is not possible to access with other account whithout having to restart the browser.
can you help me?

thanks!
#7

[eluser]ericbae[/eluser]
@vojkoz, like @pabloheim said, I think if you specify the correct parameters on database.php file, it should work.

@pabloheim, thanks for pointing it out. I have corrected the problem and pushed the changes to the GitHub repository. I basically "mimicked" Facebook logout process and then redirect to auth/logout, which now works fine.

Also, for those who want to actually test out this in real life demo, I have set it up on one of my domains. You can check it out at

http://www.naturish.com

You should be able to test the whole thing. Smile Hope you guys enjoy.
#8

[eluser]VojkoZ[/eluser]
My mysql password is incorrect Smile sory..
Good work ericbae ..
#9

[eluser]vanquish[/eluser]
Thanks so much for this great extension! We will check it out.
#10

[eluser]Aquanode[/eluser]
Great work thanks!




Theme © iAndrew 2016 - Forum software by © MyBB