Custom Social Providers

Sometimes you may require authentication with an OAuth Provider that JFBConnect does not currently support. JFBConnect allows for the "drop in" of a provider implementation that will be discovered when JFBConnect.

The following rough steps will provide a quick overview of how to format this provider implementation to get basic OAuth integrated for a custom social provider.

Creating a Provider Directory Structure

Create the following provider structure:

Custom Provider - Directory Structure-provider_PROVIDERNAME (directory)
--media (directory)
---images (directory)
----provider (directory)
-----PROVIDERNAME (directory)
------icon.png (file)
------icon_label.png (file)
--profile (directory)
---PROVIDERNAME.php (file)
--provider
---PROVIDERNAME (directory)
----config (directory)
-----config.xml (file)
----widget (directory)
-----login.php (file)
-----login.xml (file)
---PROVIDERNAME.php (file)
--provider_PROVIDERNAME.php (file)
--provider_PROVIDERNAME.xml (file)

Custom Implementation

Our suggestion is to start with one of the existing provider implmentations in JFBConnect, found in /components/com_jfbconnect/libraries/provider directory. Although the directory structure will be slightly different than the above necessary structure, it's a good starting point.

  • Media folder - the media subfolders above will hold the icon and icon_label.png images that will be used as social login buttons in SCLogin and JFBConnect
  • Profile folder - this defines how to fetch the profile fields from the social network providers.
  • Provider folder
    • Config folder - sets the names for the api and secret keys.
    • Widget folder - sets the social login button and easy-tag names.
    • PROVIDERNAME.php - defines the OAuth implementation with authurl and tokenurl and how to fetch the user ID from the social network.
  • provider_PROVIDERNAME.php - tells JFBConnect that this plugin should be detected as a social provider.

After the above implementation, you should zip and install the plugin. JFBConnect should detect the custom provider after it is enabled.