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

[eluser]Tanag[/eluser]
Do you have any instructions for adding this functionality if we already have a site with tank auth running?What files were changed? I don't want to overwrite my install with this as I've made some other edits of my own.

Thanks for the mod, been looking for something like this!
#12

[eluser]ericbae[/eluser]
Hi @tanag,

If you look through the code, it isn't too difficult to figure out what is going on. I'll try to briefly summarize here.

1. A new column is added to "user_profiles" table called "facebook_id", which will store the facebook ID of the user, if he/she connects using Facebook OpenGraph API

2. Assuming you have your Facebook application ID registered, you can put the Facebook connect button code. In this code, you need to specify a controller & method to which the user will be redirected to after clicking the Facebook connect button.

3. The controller & method in XTA project is "auth_other" and "login_fb". I think you can safely copy this and put it into your project. You may need to slightly modify the method to make sure it works. Basically, it's checking whether user's facebook id is already in the DB or not. If it exists, we "simulate" tank_auth log-in process, otherwise, we direct users to a "fill in your detail" page.

I hope that helps. Give it a go and then ask questions if you run into problems.

Eric
#13

[eluser]Tanag[/eluser]
Thanks! I'll give it a try and let you know if I have any issues. Smile
#14

[eluser]imcl[/eluser]
Hi Eric, thanks for the code! I'm really itching to get this implemented on my application.
I already have Tank_Auth installed (as another poster mentioned before). The DB changes seem straightforward but I'm more concerned about the integration between your code and Tank_Auth.

Did you make any changes to the Tank_Auth code in order to create XTA?
I wonder if I should run a diff between my Tank_Auth files and the ones you put on GitHub and then merge the two.

Any suggestions?
#15

[eluser]ericbae[/eluser]
Hey there imcl.

As far as I am aware, I made sure that I kept all the Tank Auth library code as "unchanged" as possible. Having said that, I did have to make some necessary changes to some view files (e.g. login.php).

But the core library, I am quite certain that there aren't any new changes. I guess it doesn't hurt to compare your auth.php controller file with the one that I have uploaded, but even if there were, I'm sure they will be minor ones.

Do try and let me know if you run into any problems!
#16

[eluser]Viruthagiri[/eluser]
@ericbae Good work buddy. :-)
#17

[eluser]RJ[/eluser]
Great contribution Eric! Easy pezy
#18

[eluser]german.zvonchuk[/eluser]
Great work, great library. Thanks!

I have a question:
How can I get email and picture of the person who is authorized by facebook?
#19

[eluser]german.zvonchuk[/eluser]
Hello,
I've twice encountered such error. I hasten to inform you of this.


Code:
http://domain.com/index.php/auth_other/fb_signin?code=weyqBTiincZ1267f8cfkjX9XUyVKrQBgHYEM4jlYKXo.eyJpdiI6IkZTYWNyXzN0NWRDeFMyZjVlblEzN3cifQ.OxbzY_ExwOt3IsCjtnz2mSbH8wc2DBImeq4R1cdvjaCLusSjb7TrIsQVU37zJthJHvqcP9X6TLVZlcDLf3ZhiybV7EzKMSkLykJc3Hy0Pe-z-0-Zfeme6zRl-djZEr8JRnQaNSftPMPnt_P8O7tW5w


Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: id

Filename: controllers/auth_other.php

Line Number: 21


Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/tf0forex/public_html/system/core/Exceptions.php:170)

Filename: libraries/Session.php

Line Number: 671


Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: id

Filename: controllers/auth_other.php

Line Number: 22


Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/tf0forex/public_html/system/core/Exceptions.php:170)

Filename: helpers/url_helper.php

Line Number: 541
#20

[eluser]german.zvonchuk[/eluser]
facebook_model have error.

method: getPicture

Code:
function getPicture()
{
    $cookie = $this->get_facebook_cookie();
    $user = @json_decode(file_get_contents( 'https://graph.facebook.com/me/picture?access_token=' .    $cookie['access_token']), true);
    return $user;
}

[function.file-get-contents]: failed to open stream:

file_get_contents - can't get content because of url redirection.
My question is how can I get redirection url (direct image url)?




Theme © iAndrew 2016 - Forum software by © MyBB