![]() Here are just a few examples of how your website and social media profiles can work as an efficient team: Social platforms enable prospects to interact with your brand authentically.Īdding social platform buttons and widgets to your website can help your presence reach its fullest potential. It enables your website to work in tandem with social media platforms that will host a forecasted 4.59 billion users in 2022. It seems like standard practice to inject an additional group of settings into the top of the form as a fieldset.ĭon’t forget, you'll need to create a submitForm() method to take the values from your form and inject them into the Drupal configuration.Social media integration is paramount for increasing your brand reach. The form you define here will receive a series of default form elements from Social Auth. This is done via a settings interface provided by the Social Auth module. Settings FormĪs we have a settings object we need some way of filling the object with custom data. The class should extend the SettingsBase, which is part of the Social Auth module. This object is automatically populated and injected into your network plugin so you can pass these settings over to your OAuth client object. Social Auth uses an internal setting system to pass settings to your custom authentication class. In my example, it generates an instance of GenericProvider. This class must implement a method called initSdk(), which must return an OAuth client. "class": "\Drupal\social_auth_custom\Settings\CustomAuthSettings", My implementation = "social_auth_custom", However, several implementations extend a package called OAuth 2.0 Client, which comes with its own generic authentication client.Īs this class is a plugin, it must have an annotation at the start which details what the basic settings of the plugin are. Some OAuth providers have their own clients for providing authentication. Looking at the modules that implement Social Auth, there are several ways of doing this. This class will create the underlying authentication library that will be used to authenticate against your OAuth instance. The following components are needed: Social Network Plugin Using a simple OAuth 2.0 compliant authentication system integrated with the Social Auth framework to authenticate with the server. Remember, you'll need to separate the client with the authentication server or you’ll have problems. You’ll need a way of providing a central mechanism for users to authenticate against your systems. There are a few options available for OAuth 2.0 authentication servers ranging from standalone applications to Drupal modules like OAuth2 server, that turn Drupal into an authentication server. I decided to see if it was possible to utilise the framework provided by the Social Auth module to integrate with an OAuth 2.0 provider I had created. I won’t go into how OAuth 2.0 acts as an authentication system, that would be an article in itself. However, there are some good tutorials. You can integrate your site with Google or Facebook and other providers to allow your users easy access to your site.Īll of these integrations are very well documented/ For example, where to go within Google developer console to set up the OAuth 2.0 endpoint and then to integrate this with your Drupal site. ![]() There are examples of each type of module available on. For example, Facebook like buttons on node pages etc. ![]() Social Widgets provides a way of embedding social media share widgets into your site.Meaning users could allow the Drupal site to post to Twitter on their behalf. Social Post allows your Drupal site to post to a social media account using a certain account.The OAuth account is associated with the Drupal user account. Social Auth provides a mechanism for users to log in or register with your Drupal site.The initiative itself proves three ways of interacting with Drupal: If you’ve ever logged into a site with your Google account and seen “this site would like access to these things”, you’ve seen OAuth 2.0. Essentially it acts as a wrapper around OAuth 2.0 integration (an authentication system many social media providers use). And it's used to create a framework for other components to plug into. The Social API module is the main hub of this initiative. Meaning, a user can register or login to a Drupal site using a social media account, like Facebook or Twitter. Done so to create a foundation that allows Drupal to authenticate external services. ![]() The Drupal Social Initiative was created in 2013 as a Google Summer of Code project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |