Search code examples
facebookauthenticationkohana

Facebook login using Kohana


I'm using Kohana and I'm trying to make facebook login. Where should I place appId in my project? I put it in facebookauth/config/facebook file but it's still showing me previous AppId that I have used. Is there another place that I have to change it? My code in config file is something like this:

return array(
    'appId'			=> 'digits',
    'secret'		=> 'ahgtdhdjsd',
    'cookie'		=> true,
 'redirect_uri'   => URL::site(Request::current()->uri(), true)

And path to facebook login is :

https://www.facebook.com/dialog/oauth?client_id=OldAppId&redirect_uri=mysite.com&state=2df46b19d8c71f1976b3722d7e61a&scope=email&display=page

Еdited: I found another file to change it-/config/facebook. I placed the same code - appId, secred and cookie but now link is: mysite.com/fbLogin?code=AQAfKFVji6aI0Xx1CtcW4JqKmj2LIY6Yx13BrHRfmUDIF2vpmBlNwSouBUAsCflXI9vImTc6gwurBmDKF9uub_MTmd3gRQmFP6LdiyVMJbJ0a9CSJKKcJR1BFftYajjK

What's wrong with it? It should be the same as the above link but only appId to be changed? Can anybody help me?


Solution

  • Now that you have updated the other config file the code is working as expected. The URL you're seeing looks like you have already authorized your App with your personal Facebook account and were redirected by Facebook or are already logged in and don't need to be redirected by Facebook. Try clearing all your cookies or using another browser or incognito session to see what the flow looks like when you're not already logged in.