How to login using Social Auth (Facebook and Google)

How to enable Google login

  1. Open in a new window the Google Cloud.
  2. Select a Project on the top and choose New project.

  1. Choose a Project name and press Create.
  2. Go to APIs overview then choose Credentials, on the left menu.

  1. Choose Create Credentials -> OAuth client ID and then click on Configure consent screen.

  1. Now you need to enter a Product name and you can fill any of the other optional fields you want. Click Save.
  2. After that, create a credential for OAuth client ID.

  • Application type: Web application.
  • Authorized Javascript origins: Your site URL here. ex: https://yourdomain.com
  • Authorized redirect URI: ex: https://yourdomain.com/social/login/1?hauth.done=Google

  1. Click Create.
  2. Go to http://yourdomain.com/oc-panel/addons/sociallogin
  3. Enable Google
  4. Fill ID = Client ID as appears at Google page
  5. Fill Secret = Client secret as in Google

  1. Click Update in the bottom of the page
  2. Logout.
  3. Go to login, Google should appear there.
  4. You can now test it.

How to enable Facebook login

Since March 2018 it’s required to get an SSL certificate for your domain in order to use Facebook Login. If your website is hosted on yclas.com follow this guide to get an SSL certificate. If you are using Yclas Self-Hosted read more about it here.

This social login might change depending on Facebook.

  1. Go to Facebook for developers.
  2. Click Add a New App.

  1. Select "Allow people to log in with their Facebook account"

  1. Fill the fields Display Name and Contact Email.

  1. Go to "Products" page and select "Settings" option and fill the fields:

Valid OAuth redirect URIs:
https://yourdomain.com/social/login/1?hauth_done=Facebook or
https://yourdomain.com/social/login/1?hauth_done=Facebook

Deauthorize Callback URL: _https://yourdomain.com

  1. Click Save Changes.
  2. Choose Settings -> Advanced and enable Social Discovery and Allow API Access to App Settings.

  1. Choose Settings -> Basic and copy your App ID and App Secret.

  1. Go to https://yourdomain.com/oc-panel/addons/sociallogin
  2. Enable Facebook
  3. Fill ID = App ID as appears at FB page.
  4. Fill Secret = App secret as in FB.
  5. Click Update in the bottom of the page.
  6. Logout.
  7. Go to login, Facebook should appear there.
  8. Now you can try it out.