I believe that HubSpot API can use an API key or OAuth.

The initial port will have the API key integration. OAuth can stagger.

This could mean a soft dependency to oauth or simple_oauth. I would start with simple_oauth since it's specific for OAuth 2.

Comments

nerdstein created an issue. See original summary.

thejacer87’s picture

Version: 7.x-1.0-alpha3 » 8.x-1.0-alpha1
Assigned: Unassigned » thejacer87

just about to implement this, correct me if im wrong, but it looks like those modules turn the drupal site into an oauth server. they don't enable connecting to a 3rd party api and saving tokens from said service.

ill work on porting the current implementation from the d7 module, and we can go from there

thejacer87’s picture

Status: Active » Needs review
StatusFileSize
new16.8 KB

this patch needs https://www.drupal.org/project/hubspot_api/issues/2958254#comment-12780345 first, and is based off of that.

shabana.navas’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new127.1 KB

Oauth works beautifully. Great job!

shabana.navas’s picture

Just some small nitpicks:

  1. +++ b/src/Controller/OAuth.php
    @@ -0,0 +1,85 @@
    +   * Constructs a MyController object
    

    Change MyController to OAuth

  2. +++ b/src/Controller/OAuth.php
    @@ -0,0 +1,85 @@
    +    if (!isset($_GET['error']) && $_GET['error'] == 'access_denied') {
    

    This 'if' doesn't make sense. Should it be || instead of &&?

  3. +++ b/src/Form/SettingsForm.php
    @@ -41,15 +45,130 @@ class SettingsForm extends ConfigFormBase {
    +    $title = t('OAuth Connection Status');
    

    Nitpick, but shouldn't we be using $this->t() here?

shabana.navas’s picture

Status: Reviewed & tested by the community » Needs work
thejacer87’s picture

Status: Needs work » Needs review
StatusFileSize
new16.85 KB
new3.32 KB

updated patch with the fixes

shabana.navas’s picture

Status: Needs review » Reviewed & tested by the community
volkswagenchick’s picture

Issue tags: -midcamp2018 +midcamp2019

  • thejacer87 committed a84129d on 8.x-1.x
    Issue #2952048 by thejacer87, shabana.navas: Drupal 8 - OAuth support
    
thejacer87’s picture

merged in.

made an alpha2 release

thejacer87’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.