Welcome Guest, Not a member yet? Register   Sign In
Tank Auth with Twitter authentication & Facebook
#11

[eluser]wakey[/eluser]
Sorry Eric, please ignore my post above (now edited), I didn't update my config file correctly, I was rushing through to try and get it up and running!

Seems to work fine. Thank you for all your hard work Smile
#12

[eluser]wakey[/eluser]
Hi Eric,

Just another query - don't know if you can help... Twitter login is going to Twitter but when I select "Allow" for access I am ending up in a loop instead of Twitter redirecting me back to my app.

Do you have any idea what's going on?

Thanks,
Tom
#13

[eluser]wakey[/eluser]
Apologies for all of the posts, I am getting slightly closer to solving my problem.

I have realised the callback problem is because of the way I am removing my index.php using htaccess. I use the following code -

Code:
RewriteCond $1 !^(index\.php|media|images|css|js|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]

Twitter's response which contains query strings is not getting past this. If I remove the question mark after index.php in the RewriteRule I receive my response but I get "No Input File Specified" for every page of CI app.

Does anyone have any ideas how I can accept Twitter's response whilst still removing index.php?
#14

[eluser]ericbae[/eluser]
Hey Wakey.

I don't have the code right in front of me, but I can suggest two things and hopefully they'll help.

1. On one of other projects, I have my .htaccess file as follow. I got it from another post that recommeded changing .htaccess for CI v2.0.0. I'm not sure which version of CI you are running, but I implemented XTA with CI v2.0.0

----------------------------------------
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} ^ci_2.0.0.*
RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^my_app.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteCond %{HTTP_HOST} ^myapp.com
RewriteRule (.*) http://www.myapp.com/$1 [R=301,L]

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/ericbae
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>
-------------------------------------------

I'm not sure if everything above is applicable in your situation, but it will at least guide you.

2. Another thing is that in the config.php file, I had to change the following

$config['uri_protocol'] = "REQUEST_URI";

from "auto", which was the default setting. In XTA, I think it's already changed to this. I remember awhile back ago when working with Elliot Haughin's Twitter plugin that I had to change this setting.

Hope that helps!
#15

[eluser]wakey[/eluser]
Thank you Eric! All up and running now, it's a great addition to tank_auth. Thank you for your hard work!
#16

[eluser]andjules[/eluser]
Thanks Eric. Just got back to it now. Didn't download from GIT, but found the config/tweet-lib differences, as well as the misnamed column (twitterk_id). All good now.

Great work.
#17

[eluser]imcl[/eluser]
I keep getting

Code:
An Error Was Encountered
Unable to load the requested file: auth_other/fill_user_info.php

after accepting the app on Facebook. Anyone know why this is happening?
#18

[eluser]ericbae[/eluser]
Hi Imcl.

Hm that's strange. Have you tried the demo app? (www.naturish.com). As far as I'm aware, it's working on my end. The error is obviously saying it cannot find the view file "fill_user_info.php" which should be in your "views/auth_other/" location, which is called in "auth.php" controller.
#19

[eluser]imcl[/eluser]
sorry eric, my bad, forgot to add the views.

one question though -- now after accepting the Facebook app, I am redirected back to my site, and I see a form with USER, EMAIL, and "Let me in".

Shouldn't I have been logged in after accepting the app? Why does this form show up?
#20

[eluser]ericbae[/eluser]
Currently, Tank Auth is configured to accept both "username" and "email" in its registration. But when you use Facebook, Twitter or Google, you don't provide any of these.

So at the moment, I am redirecting to a page where users can set these values.

Of course, you can set these values yourself, by automatically making up their username (e.g. get their first name and last name and append them together) or get their email address (e.g. this is more sensitive since you'll need a separate permission on FB to get the user to give you their email address).

But the caveat is that Tank Auth requires your user name and email to be unique so they can be used as a login ID (which makes sense).

So rather than trying to figure ALL the above by yourself (and probably make some assumptions along the way), the easiest method was to put another page where users can fill in extra details.

In my case, I've used this "Extra step" so that users can fill in more details like "country", "website", "gender" etc etc.

Hope that meaks sense.




Theme © iAndrew 2016 - Forum software by © MyBB