I am looking at adding a new provider and please correct me if i have this wrong, but looking at code (and lack of documentation) it seems that the only way to add a new provider is to have it included in this project? Is that correct?

Would it not be far more modular and significantly less work for the hybridauth project maintainers if this module supported provider modules?

In other words, rather than having to get an new provider css, icons, .inc file etc included into this project; we could simply create (and maintain) our own project which provided the required resources (including our library file which we would simply mention in README file had to be copied to correct library folder.

Comments

liquidcms created an issue.

duozersk’s picture

Peter,

Thank you for your interest in the module and for the request.

The module was actually written to allow other modules to do provider implementations. Every provider is a plugin - it uses ctools plugin system by defining its own plugin types. You should be able to find info on how to implement ctools plugin in your own module.

I don't recall if it now supports providing icon and css file - it might have been changed when I updated the code to use #attached property instead of drupal_add_css(). Anyway, the icon packs are also ctools plugins - once you get familiar with how to create ctools plugins it should be rather easy to create a pack with needed icons for any site/project. Or we might take another look at how to allow provider plugins to add icons.

Thanks
AndyB

liquidcms’s picture

hmm.. interesting.. i don't think that is correct but i will look deeper. So you are saying that the .inc file that you have for your providers can be located in my custom module and is not required to be within your project?

liquidcms’s picture

in your .api file there is no mention of hooks to pull in additional .inc files to get added to list of providers; also, it would make this super simple for developers if you provided an example provider module. :)

liquidcms’s picture

hmm.. nope.. my bad.. it does seem to work as a separate module.. the wonder of ctools!! :)

liquidcms’s picture

gave up trying to get icons working as ctools plugin but the provider part works as plugin. did the icon pack exactly as you state in README but no luck.

so, for now, i have simply added a drupal_add_css() call with all the icons in my module _init hook.

one other thing; has anyone created a Drupal project for a provider module? Would it be possible to list them (including the one i just wrote and am about to add as a new project on d.org) on your project home page?

duozersk’s picture

Peter,

Sure, I don't see any reason not to list the provider modules on the project page.

As for the icon packs - strange it didn't work for you, it works fine on several sites I was implementing social login on. And the default icon packs (supplied with the module) are done exactly as it is described in the README file.

Let me know when you make the code available - I will take a look and then we might use it as the example implementation of the "provider module".

Thanks
AndyB

liquidcms’s picture

Hey Andy, if you are considering adding a list of 3rd party provider modules; here is ours: https://www.drupal.org/project/hybridauth_idqoauth2

segi’s picture

Hi,

we tried to implement a new provider in our module. It looks like the module is working properly, we could reach the settings page by hand, but we don't see our new provider in the list under admin/config/people/hybridauth.
Is there any way to list it there? We tried to find a hook or something like in the hybridauth module where we can alter/add our provider to the list, but as we see at the moment it isn't possible.

sano’s picture

I think @liquidcms did not see the icons because he did not customize the css files to contain a selector/style for the newly-added provider.

... and @segi did not see the provider likely because he did not include the provider definition file into the .../hybridauth/plugins/provider/PROVIDERNAME/PROVIDERNAME.inc directory, or - possibly - the hybridauth library did not contain a (custom) corresponding provider file.