Whilst small files can be uploaded to forum posts, if you have a custom theme or module to contribute please add it on the "Add-ons" page.

TOPIC: Introducing a Facebook module for easier logins

Introducing a Facebook module for easier logins 6 years 3 months ago #1

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
In an effort to reduce the number of forgotten usernames/passwords and to make the registration + approval process near-instant, I have developed a webtrees module to integrate with Facebook for authentication. I have a beta version available for testing that I am using on two of my websites after developing this over more than a year as time permits.

The main benefit for me is that I can pre-approve Facebook friends who are family members so that they can instantly create an account and access family information without waiting for me to see the email and approve their account (which could be many hours later when they have lost interest depending on timezones involved). I prefer this over creating webtrees accounts in advance since users may forget their username or assigned password or change their email address. I find people email me when they don't know their password rather than using the password reset form. See the screenshot at http://mnoorenberghe.github.io/webtrees-facebook/#screenshots to see how this works.

I have developed the module from the beginning so that it doesn't use Facebook's JavaScript and therefore Facebook cannot track every pageview and won't slow down page load. All authentication is done on the server-side between webtrees and Facebook.

Let me know what you think,
Matthew

Project website with download links: http://mnoorenberghe.github.io/webtrees-facebook
Bugs and feature requests: https://github.com/mnoorenberghe/webtrees-facebook/issues

Git Trunk on Linux • webtrees-Facebook developer
Last Edit: 6 years 3 months ago by Matt. Reason: added screenshot
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #2

  • braulio_holtz
  • braulio_holtz's Avatar
Cool, I got to work with the integration of login with Facebook, but had made changes in login.php, all updates needed to change the file
Something that I think may have a future project is the further integration with users, users can interact with others
Last Edit: 6 years 3 months ago by braulio_holtz.
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #3

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
braulio_holtz wrote:
Cool, I got to work with the integration of login with Facebook, but had made changes in login.php, all updates needed to change the file
I see. I avoided the need to modify the core files by modifying the login interface using JavaScript.
braulio_holtz wrote:
Something that I think may have a future project is the further integration with users, users can interact with others
My next integration idea is to reference a user's current Facebook profile photo from an individual page if the individual is linked to a Facebook account and there is no existing photo.
Git Trunk on Linux • webtrees-Facebook developer
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #4

  • Shemwell
  • Shemwell's Avatar
  • Offline
  • Junior
  • Posts: 203
I was able to make it work to an extent... I used the "Import from your Facebook friends ", selected a few specific family members and set their Role as "editor", but when they try to login they still get:
"The data for the user xxxx.xxxxx was checked.
You have confirmed your request to become a registered user.
The administrator has been informed. As soon as he gives you permission to login, you can login with your user name and password.

Is there something I missed?
Barry
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #5

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
Shemwell wrote:
I was able to make it work to an extent... I used the "Import from your Facebook friends ", selected a few specific family members and set their Role as "editor", but when they try to login they still get:
"The data for the user xxxx.xxxxx was checked.
You have confirmed your request to become a registered user.
The administrator has been informed. As soon as he gives you permission to login, you can login with your user name and password.
Hello,

Can you check a few things for me:
  1. Is your site supposed to require approval? (I haven't tested on sites that don't require approval)
  2. After the user tries to login, check the user list (admin_users.php) to see what is shown in the "Approved" column?
  3. On the Facebook module admin page, check that the user moved from the "Pre-approve users" section to the "Linked users" section
  4. Did these users already have accounts in the tree? Were they approved?
  5. Output from the site logs (admin_site_logs.php) may give more information

If you have a github account, we can try sort this out in a new issue there: https://github.com/mnoorenberghe/webtrees-facebook/issues/new

Thanks for giving it a try
Git Trunk on Linux • webtrees-Facebook developer
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #6

  • Shemwell
  • Shemwell's Avatar
  • Offline
  • Junior
  • Posts: 203
Is your site supposed to require approval? - Allow visitors to request account registration - Yes, if set to No anybody can log on as visitors.
Require an administrator to approve new user registrations - Yes, if No, they can log on but only as visitors.

After the user tries to login, check the user list (admin_users.php) to see what is shown in the "Approved" column?
Their name appears... Verified - Yes - Approved - No

On the Facebook module admin page, check that the user moved from the "Pre-approve users" section to the "Linked users" section
Associate a webtrees user with a Facebook account. - Yes their name appears, but does not move from the pre-approved section.

Did these users already have accounts in the tree? Were they approved? - No

Output from the site logs (admin_site_logs.php) may give more information

2013-12-28 13:19:09 auth User xxx.xxx verified their email address 75.143.73.131 Shemwell
2013-12-28 13:19:09 auth User ID: 81 (xxx.xxx) changed password 75.143.73.131 Shemwell
2013-12-28 13:19:08 auth User registration requested for: xxx.xxx 75.143.73.131 Shemwell

A 2nd pre-approved facebook (non-webtrees)user emailed me with this error:
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

I don't have a github account.

I must have done something wrong....
Barry
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #7

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
Matt wrote:
On the Facebook module admin page, check that the user moved from the "Pre-approve users" section to the "Linked users" section
Associate a webtrees user with a Facebook account.
Shemwell wrote:
- Yes their name appears, but does not move from the pre-approved section.

So the name still appears in the pre-approved users section? Does it also appear in the linked users section? Can you double-check that the Facebook account they used to login with matches the one you pre-approved? You can get their username from their Facebook profile URL (periods are ignored). If they logged in using Facebook, there should be an entry in the linked users section for their new account.
Shemwell wrote:
A 2nd pre-approved facebook (non-webtrees)user emailed me with this error:
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
Does your website have multiple domains? This means that the URL in your Facebook app settings at https://developers.facebook.com/apps doesn't match the domain name used to login. I see both www.shemwellfamily.com and shemwellfamily.com work so that is likely the problem. Either redirect all users to one or the other or try adding "shemwellfamily.com" (without www) to 'App Domains' on Facebook. Also, make sure your app is not in sandbox mode. See the screenshot for an example.



If you send me a direct message on the forum and provide contact details we can sort this out over chat which will be faster. Also, providing uncensored screenshots of the module configuration page excluding the App secret key would help.

You could also test with Facebook test users if you uncheck 'Require verified Facebook accounts' in the module settings.

Apologies that it's not working smoothly but I don't have enough details to figure out the problem yet.
Git Trunk on Linux • webtrees-Facebook developer
Last Edit: 6 years 3 months ago by Matt.
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #8

  • Shemwell
  • Shemwell's Avatar
  • Offline
  • Junior
  • Posts: 203

Can't find sandbox.... the pre approved names are identical. I don't know how to contact you directly thru the forum.... sorry I'm trying... Thanks. If it helps I'll give you admin access to facebook and webtrees. This email address is being protected from spambots. You need JavaScript enabled to view it.
Barry
The administrator has disabled public write access.
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Introducing a Facebook module for easier logins 6 years 3 months ago #9

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
Shemwell wrote:
Can't find sandbox.... the pre approved names are identical. I don't know how to contact you directly thru the forum.... sorry I'm trying... Thanks. If it helps I'll give you admin access to facebook and webtrees.
That photo looks different than what I see so Facebook probably gave you a new UI. That shouldn't affect the original problem though.

I guess there is not direct messaging on this forum, my mistake. I have sent you an email.
Git Trunk on Linux • webtrees-Facebook developer
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #10

  • Fordy
  • Fordy's Avatar
braulio_holtz wrote:
Cool, I got to work with the integration of login with Facebook, but had made changes in login.php, all updates needed to change the file
Something that I think may have a future project is the further integration with users, users can interact with others

Hi - interesting - I uploaded a clean install - activated modules, set up the app with no issues, and can associate user accounts correctly, however, I don't have the facebook login box or icons on my login page - did I miss something?
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #11

  • braulio_holtz
  • braulio_holtz's Avatar
Fordy
You follow the instructions of the module?
The App ID and secret can be setup at developers.facebook.com/apps.

The photos on the individual page changes, but does not change the picture on the family tree
Last Edit: 6 years 3 months ago by braulio_holtz.
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #12

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
Fordy wrote:
Hi - interesting - I uploaded a clean install - activated modules, set up the app with no issues, and can associate user accounts correctly, however, I don't have the facebook login box or icons on my login page - did I miss something?

Can you post a link to your website while the module is enabled so I can investigate?
Git Trunk on Linux • webtrees-Facebook developer
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #13

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
I have released a new version (v1.0-beta.2) of the module to fix Facebook logins for users with periods in their Facebook username. Thanks to Shemwell for the report and help debugging.

This version also adds one feature:
  • Show a user's Facebook profile photo on their INDI page if highlighted media doesn't exist.

Enjoy!
Git Trunk on Linux • webtrees-Facebook developer
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #14

  • Fordy
  • Fordy's Avatar
Matt wrote:

Can you post a link to your website while the module is enabled so I can investigate?

Sure - fordfamily.co.nz - am running fancy treeview with justblack theme on 1.5.1 - have tried switching default themes - makes no difference
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #15

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
Fordy wrote:
Matt wrote:

Can you post a link to your website while the module is enabled so I can investigate?

Sure - fordfamily.co.nz - am running fancy treeview with justblack theme on 1.5.1 - have tried switching default themes - makes no difference

Go to http://www.fordfamily.co.nz/admin_module_menus.php and make sure that the Facebook "menu" is set to Show to Visitors.
Git Trunk on Linux • webtrees-Facebook developer
Last Edit: 6 years 3 months ago by Matt.
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #16

  • Fordy
  • Fordy's Avatar
Matt wrote:

Go to http://www.fordfamily.co.nz/admin_module_menus.php and make sure that the Facebook "menu" is set to Show to Visitors.

Hi - it is - I made sure I followed your instructions (see screenshot) - the only thing I can think of is - in your instructions step 3:

Once the App is created, indicate that you want to integrate with Facebook as a 'Website with Facebook Login' and provide the URL to your webtrees site.

I think another person mentioned this earlier in this thread - with the new app gui we don't see/have this option - so I am guessing the issue could be related to that? My Facebook app/setup is similar to the other user's earlier in this thread.

The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #17

  • Shemwell
  • Shemwell's Avatar
  • Offline
  • Junior
  • Posts: 203
I "Like" it...
Barry
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #18

  • Matt
  • Matt's Avatar
  • Offline
  • New
  • Software Developer. BCS
  • Posts: 38
It seems like the code doesn't run if "Require visitor authentication" is on for the tree. I'm not sure if this is something I can workaround but I'll take a look. I filed an issue https://github.com/mnoorenberghe/webtrees-facebook/issues/7
Git Trunk on Linux • webtrees-Facebook developer
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #19

  • Shemwell
  • Shemwell's Avatar
  • Offline
  • Junior
  • Posts: 203
No need, easy fix... just add Privacy restrictions for media, data or anything else you don't want a visitor to see. My site..... well honestly, I can't even get my own mother to log on, so I'm hoping Matt's module will make it an easy no-brainier sign up and bring in a few (pre-approved) facebook family members.
Thanks Matt -great idea.
Barry
The administrator has disabled public write access.

Introducing a Facebook module for easier logins 6 years 3 months ago #20

  • braulio_holtz
  • braulio_holtz's Avatar
Alignment was not good
I made a change to the facebook.css
# facebook-login-box {
     display: block;
     padding-right: 1em;
}
but it did not work
Changed in facebook.js
'<div id="facebook-login-box" style="display: inline-block">' +
for
'<div id="facebook-login-box">' +
worked
Last Edit: 6 years 3 months ago by braulio_holtz.
The administrator has disabled public write access.
Powered by Kunena Forum