The Social Login plugin for October CMS allows customers to register and log in to your site with their Facebook, Google, Twitter and other social media accounts. The login page is completely customisable and can theme seamlessly into any October site.
Supports
- Extensible! Don't see one you want? Add it!
New! Backend login support. Check the 'Enabled on backend?' checkbox on a per-provider basis in Settings - Social Login.
Have a feature suggestion? Found a bug or need support?
Please use the contact form on my website and I'll get back to you as soon as possible. I usually respond within a few hours depending on timezone differences.
The following plugin is required
Installation
This plugin relies on RainLab.User, so make sure you have that installed.
Go to System - Updates and in the search field enter Flynsarmy.SocialLogin
Usage
- Fill in any required credentials in System - Social Login, making sure the
Enabled?
checkbox is ticked when you're done. - Add
User - Account
andSocial Login
components to your login page - Copy /plugins/rainlab/user/components/account/signin.htm to your themes partials/account folder
- Where you want your login links, add
{% for name, link in social_login_links %} <a href="{{ link }}">{{ name }}</a> {% endfor %}
Remember that you can format it any way you like.
Settings
Sometimes you'll want to decide which page to redirect to on login/error. For example perhaps you have a log in page before checkout in an ecommerce plugin and want to redirect to the cart on login. This can be done by appending the following query string values to your login links:
Query String Param | Default | Description |
---|---|---|
s | / | Success page redirect URL (relative) |
f | /login | Error page redirect URL (relative) |
Example usage:
{% for name, link in social_login_links %} <a href="{{ link }}?s={{ 'home'|page }}&f={{ 'login'|page }}">{{ name }}</a> {% endfor %}
Events
Developers can change the way logins are handled through several events detailed below.
Event | Parameters | Description |
---|---|---|
flynsarmy.sociallogin.handleBackendLogin | array $provider_details, array $user_details, User $user | Triggers before backend login. Return true to halt the login process |
flynsarmy.sociallogin.handleLogin | array $provider_details, array $user_details, User $user | Triggers before frontend login. Return true to halt the login process |
flynsarmy.sociallogin.registerUser | array $provider_details, array $user_details | Triggers before registering a new user for attaching to a social account. Optionally return a User object |
Other Notes
Twitter doesn't return an email address, so when logging in with Twitter, a new user account is created and associated with the Twitter account.
Examples
To get your login page looking how mine is in the marketplace screenshot here's my /themes/travu/partials/account/signin.htm:
<form id="login" data-request="onSignin"> <div class="form-group"> <label for="userSigninEmail">Email</label> <input name="email" type="email" class="form-control" id="userSigninEmail" placeholder="Enter your email"> </div> <div class="form-group"> <label for="userSigninPassword">Password</label> <input name="password" type="password" class="form-control" id="userSigninPassword" placeholder="Enter your password"> </div> <p align="right"> or sign in with {% for name, link in social_login_links %} <a href="{{ link }}" class='login {{ name|lower }}'><i class="fa fa-2 fa-{{ name|lower }}"></i></a> {% endfor %} </p> <button type="submit" class="btn btn-default">Sign in</button> </form>
-
Alfred Robilahy
Found the plugin not useful on 27 Jul, 2023
I got an error on /flynsarmy/sociallogin/Facebook
Error 503 Backend fetch failed Backend fetch failed
Guru Meditation: XID: 885537364
Varnish cache server
-
ade erwin
Found the plugin useful on 11 Feb, 2019
can you help me please,, i get error like this
Object of class RainLab\User\Classes\UserRedirector could not be converted to string
i can't resolve this issue
-
David Ricardo
Found the plugin useful on 20 Jan, 2019
This is a great plugin! I'm able to log in using Facebook. But I have a problem when login using google. When I try to log in using google, it shows up the login page provided by Google. The problem is it redirect to my login page but not login to my website. What should I do?
-
Jesper Andersen
Found the plugin useful on 17 Oct, 2018
Works great, really enjoy the fact that you've included so many Events.
One minor change you should consider. I, for one, am allowing users to make custom usernames (so not their e-mail), which causes an error in the find() method on this line: $user = Auth::findUserByLogin( $user_details['email'] );
You should consider either making an Event here as well or look up the user by Email instead of by login.
-
Shultz
Found the plugin useful on 14 Apr, 2018
how can i add other social?
-
yahya
Found the plugin useful on 10 Apr, 2018
How to get the token secret and How to add another provider like ok.ru or vk.com
-
Rolands Z
Found the plugin useful on 20 Feb, 2018
If you have issue regarding
Class '\Laravel\Socialite\SocialiteServiceProvider' not found
just delete plugin, or, in Plugin.php file comment out line 67,68
App::register('\Laravel\Socialite\SocialiteServiceProvider'); AliasLoader::getInstance()->alias('Socialite', 'Laravel\Socialite\Facades\Socialite');
and then run in console
composer require laravel/socialite
-
Datu Shim Mokhtar Aliman
Found the plugin useful on 21 Jan, 2018
Successfully installed in one of my website but failed on the other. I don't know why. Added on composer and updated then installed on both websites with the same procedure. Can you help? Step by step.
-
mehdi samirakh
Found the plugin not useful on 28 Nov, 2017
after installing i have a error
Class '\Laravel\Socialite\SocialiteServiceProvider' not found
-
Elton
Found the plugin useful on 30 Sep, 2017
Had a bad day because of this plugin. Just not able to use specific 1.0.16 version. On installation, it does 1.0.18 which requires whole system to be upgraded (which currently is throwing errors). Anyway I can just use the 1.0.16?
-
Meysam Mahfouzi
Found the plugin useful on 21 Apr, 2017
Works as expected. Thank you!
-
Art
Found the plugin useful on 7 Apr, 2017
Usefull but facebook changed it's login API so need to update the plugin because now it's not working.
-
Jorge andrade
Found the plugin useful on 3 Jul, 2016
Super useful, only one problem, login only one user, i hope so fixed this.
-
Matiss Janis Aboltins
Found the plugin useful on 3 Aug, 2015
Great contribution to the community. Easy to set up and use. Thanks!
-
Alvaro Cánepa
Found the plugin useful on 6 Jul, 2015
Hello. Great job! It would be nice if can set permissions on backend.
Thanks
-
Akhil Kumar
Found the plugin useful on 12 Mar, 2015
hi does this plugin has been updated as per RC? i have purchased this plugin and want to use with RC of OctoberCMS.
-
Flyn San author
Replied on 4 Jun, 2015
Yes this plugin works with the RC (now 1.0).
-
Keios
Found the plugin useful on 7 Jan, 2015
It's useful, thank you.
-
imunisasi
Found the plugin useful on 6 Dec, 2014
Extensible! Don't see one you want? Add it! could you provide some documentation to add another social media for this one thanks for great plugin !!
-
1.1.3 |
Fix session data persistence Feb 04, 2023 |
---|---|
1.1.2 |
Syntax fix for October 3, add flynsarmy.sociallogin.extendUserBeforeRegister event. Aug 25, 2022 |
1.1.1 |
Minor bug fix Oct 11, 2021 |
1.1 |
!!! Updated to HybridAuth 3.7. Test logging in on each enabled provider after updating! Oct 11, 2021 |
1.0.30 |
Fix for databases that don't support defaults on TEXT fields Sep 18, 2019 |
1.0.29 |
Check user avatars correctly Jul 28, 2019 |
1.0.28 |
SQLite compatibility fix Jun 29, 2019 |
1.0.27 |
Fix user registration Jun 23, 2019 |
1.0.26 |
Fix twitter login Jun 23, 2019 |
1.0.25 |
Fix backend errors when settings have not yet been added Jun 22, 2019 |
1.0.24 |
Fix facebook login Jun 22, 2019 |
1.0.23 |
Switch back to HybridAuth Jun 20, 2019 |
1.0.22 |
Bug fix in Rainlab.Users pages Oct 01, 2018 |
1.0.21 |
Update socialite May 20, 2018 |
1.0.20 |
Upgrade to latest socialite Mar 11, 2018 |
1.0.19 |
Add backend permission requirement Oct 15, 2017 |
1.0.18 |
!!! Requires October build 420 or higher. Aug 27, 2017 |
1.0.17 |
Fixed issue registering new users May 01, 2017 |
1.0.16 |
!!! Important update with breaking changes. Apr 29, 2017 |
1.0.15 |
Compatibility fix with RainLab.GoogleAnalytics Feb 01, 2017 |
1.0.14 |
Singleton trait fix Feb 15, 2016 |
1.0.13 |
Deprecated code fix, settings page fix Feb 15, 2016 |
1.0.12 |
Update login providers Feb 15, 2016 |
1.0.11 |
Modified table key name Dec 21, 2015 |
1.0.10 |
Don't add multiple Google associations to users Apr 24, 2015 |
1.0.9 |
Google login fix Mar 15, 2015 |
1.0.8 |
RC compatibility update Feb 21, 2015 |
1.0.7 |
Rename login to username to match RainLab.Users latest update Oct 16, 2014 |
1.0.6 |
Add login details when registering users Oct 08, 2014 |
1.0.5 |
Fix password confirmation error Sep 03, 2014 |
1.0.4 |
User registration bug fix Aug 21, 2014 |
1.0.3 |
Fixed RainLab.User integration Jul 28, 2014 |
1.0.2 |
Require RainLab.User Jul 15, 2014 |
1.0.1 |
First version of SocialLogin Jul 04, 2014 |
Upgrade guide
Upgrading to 1.0.16
Version 1.0.16 of the Social Login plugin is a significant rewrite with a few breaking changes. We've moved from a much older login provider library to Laravel Socialite. This should provide reliability improvements when logging in solving many of the issues users were experiencing.
Before Updating
- In Admin go to Settings - Social Login and copy your login providers' settings. Some of these may need to be re-entered. You can just paste the same details back in again.
After Updating
- Paste your copied login provider settings back in the Settings - Social Login area of admin if they've disappeared.
- If you have any third party plugins extending Social Login by adding extra login providers, they may need to require in new dependencies if they were relying on the old packages Social Login used. Your developer will need to handle this one. If you only see Google, Facebook and Twitter in Settings - Social Login area of admin then you probably don't need to worry about this.
Other FAQ
- No changes are needed on the frontend of your site.
- Frontend users will not need to reassociate their social accounts with your site. Everything will keep working for them provided you follow the backend steps above.