Post share on facebook
-
Hi Kevin. I’m using your plugin. It works very good.
What do I have to do to enable sharing post on facebook with the plugin activated?
-
Hi, thanks for using Force Login!
I’m not sure I understand what you’re asking for, you should be able to share URLs on Facebook regardless of whether or not Force Login is active.
However, any non-logged-in visitors trying to view the URL you shared may be redirected to login first – which is the point of the plugin.
Are you maybe asking how to whitelist URLs for visitors coming from Facebook? You might be able to whitelist certain URLs shared on Facebook if they include some query string parameter you can check against to whitelist those URLs.
Checkout the Force Login Wiki on GitHub for examples of the different methods for whitelisting dynamic URLs, including a URL based on query string parameter(s) and/or value(s):
Let me explain more.
The user of my website is already log in.
And them they wanna share some post on facebook them got page asking to login.
When they try, facebook share can’t accesses my url post, g.e.:or
Follow same screens:
Trying to share post with user already logged in. Deferents url of facebook sharer.

Follow same screens user was logged in trying debug ‘https://developers.facebook.com/tools/debug/sharing/’
I put of Force Login plugin for now, but I wanna keep using it.
-
This reply was modified 9 years, 6 months ago by
jeandersoncruz.
-
This reply was modified 9 years, 6 months ago by
jeandersoncruz.
-
This reply was modified 9 years, 6 months ago by
jeandersoncruz.
Images on correct order.





Ah, I see now.
The problem here is Facebook (facebook.com) is trying to access the page it’s told to share, but Facebook is not a logged-in user and thus gets sent the login URL instead.
The Facebook Sharer tool crawls and pulls the information (title, image, description..etc) that is being displayed in the preview from the URL’s
ogmeta tags – in this case, the information for the login screen it’s seeing.You’ll have to configure a whitelist/bypass of Force Login for visits by the Facebook Crawler. Facebook provided information on IP whitelists and User Agent strings for Facebook’s crawlers in their Facebook Crawler guide.
If you can get your website to identify the visitor as the Facebook Crawler, you may then have Force Login bypass the login redirect based on that visitor.
If you find a solution to this, please post it here to share with others. Thanks!
Check out this post about how to identify the Facebook User Agent in PHP:
http://stackoverflow.com/a/8626828/1062974Try adding the following code to your theme’s functions.php to allow Facebook to bypass Force Login:
https://gist.github.com/kevinvess/8f831b8ad29bef4b544d078b4bb55e6bLet me know if this works – thanks!
-
This reply was modified 9 years, 6 months ago by
Kevin Vess. Reason: Set links to open in new window
-
This reply was modified 9 years, 6 months ago by
Kevin Vess. Reason: Fixed spelling
hi
i have the same problem
and i am not sure that i understand what you mean ?
where exactly in functions.phpIf you noticed, this is a “resolved” topic.
If the troubleshooting already posted made no difference for you, then, as per the Forum Welcome, please post your own topic. That way you stand a good chance of getting the assistance you want.
ok thank you i will
You are welcome 🙂
-
This reply was modified 9 years, 6 months ago by
The topic ‘Post share on facebook’ is closed to new replies.