News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Naytheet Social Login

Started by Naytheet, November 13, 2023, 02:49:27 PM

Previous topic - Next topic

Naytheet

Link to the mod

Naytheet Social Login


Author: Naytheet



Compatibility
SMF 2.1.x

Introduction
This mod allows a user to automatically log them in with Facebook or LinkedIn social login.

Installation Information:
The Package Manager should work in most cases, if you have problems installing please use the discussion thread as well as Manual Installation of Mods

Usage

French and spanish languages are included. Message me if any problem with making it work or any trouble to understand what to do. This Social Login package had to be done done after many changes occured in SMF and FB and relatives apps, making any SL plugin deprecated.
Important notice : FB social login had to be dropped off because of its recent errors. The actual description only applies to LinkedIn's. However, I can provide the FB & LI version of it all for anyone who has working FB keys.


You just have to get your free-of-charge id and secret id to make it work for each social network as I guess there's no chance for us to get them with SMF. If someone wants to create universal keys for SMF though, kindly get in touch with me, that would avoid to have to work on those boring compulsory configurations.

This is the first version of this SL, and it requires to get two network app with their keys and FB's law stuff files. Social networks are FB and LinkedIn.

Here is the how-to notice to get the values to be inserted in the admin page fields.

FB configuration

Go to the FB dev page and create a Facebook Login app. Fill in the required data in the corresponding fields. Many fields are optional. You'll have to switch the app Mode: Development to Live mode to make it work, at the top of the page. Prior to it, you first have to add two law urls stuff regarding your forum. Click on Settings -> basic in left nav margin and add the Privacy Policy URL and User data deletion URL. You can find auto generated text for these files on the web.

Click on Facebook Login at the end of left nav margin. In the Valid OAuth Redirect URIs big field, you have to add <your SMF domain name> (www.example.com is a domain name).

Don't forget to click on Save changes at the bottom of the page. You'll find your app keys in Settings > Basic area. Add them in your mod page while you can.

About the Long-lived token, you have to renew it until it expires, i.e. before two months after its generated value, and save it in your SMF mod page. To get it, go to the basic token page and follow the guide to get the basic token. Once done, get the Long-lived token by following the guide here. And don't forget to add this token to your mod page.

LinkedIn configuration

Dashboard is located at https://www.linkedin.com/developers.

It's easier as you just have to choose a company so you can get your keys afterwards. Product to choose is called "Sign In with LinkedIn". OAuth 2.0 scopes has to show r_emailaddress and r_liteprofile. Add these scopes when or where you can.

https://www.example.com is an example of SMF domain URL. Authorized redirect URLs for your app have to include at least :



https://www.linkedin.com/developers/tools/oauth/redirect
<your SMF domain URL>/index.php?action=login
<your SMF domain URL>/index.php
<your SMF domain URL>/
<your SMF domain URL>
<your SMF domain URL>/index.php?social_login=LinkedIn
<your SMF domain URL>/?social_login=LinkedIn




How it works

Once the user is connected from his SL account and back to your SMF, the user's nickname will be registered with his/her network's picture to your SMF and he/she'll be connected subsequently. He/she won't be registered again the next times he uses Naytheet SL. Password is the same for any SL people and doesn't need to be known, so please don't share it with anybody.

Recommended

You should then add this kind of notice to your SMF forum :

About the Social login buttons
  • Use them with caution, you would get multiple nicks in the forum when you post with different logins.
  • Many advanced and basic features of the forum needs you to provide the password, so keep in mind you have to register a proper account to use them as you don't have to use any password to log in.
  • Report here any glitch, and post any remark or suggestion in this topic.
In me sanitas et robur

Advertisement: