Function to connect facebook api in login.