- Merge request !98Issue #3030847: Add support for feeds requiring OAuth 2.0 Authorization → (Open) created by prashantgajare
- 🇺🇸United States cainaru Norwood, NY, USA
A while back when testing this, I noticed that other feeds that are using HTTP Basic Auth, but not Oauth, start failing with this patch. I wonder if modifying the
submitConfigurationForm
like the following might help (particularly with the failing tests) ?public function submitConfigurationForm(array &$form, FormStateInterface $form_state, FeedInterface $feed = NULL) { $feed->setSource($form_state->getValue('source')); // Only submit these if the feed has the Oauth option present. if (isset($form_state->getValue('authorization_options')['feed_authorization_setting'])) { $feed_config = [ 'feed_authorization_setting' => $form_state->getValue('authorization_options')['feed_authorization_setting'], 'access_token_url' => $form_state->getValue('authorization_options')['access_token_url'], 'grant_type' => $form_state->getValue('authorization_options')['grant_type'], 'client_id' => $form_state->getValue('authorization_options')['client_id'], 'scope' => $form_state->getValue('authorization_options')['scope'], 'username' => $form_state->getValue('authorization_options')['username'], ]; $client_secret = $form_state->getValue('authorization_options')['client_secret']; $password = $form_state->getValue('authorization_options')['password']; // Only save the client secret and/or password if they have been changed. if (!empty($client_secret)) { $feed_config['client_secret'] = $client_secret; } if (!empty($password)) { $feed_config['password'] = $password; } $feed->setConfigurationFor($this->plugin, $feed_config); } }
And perhaps setting the
feed_authorization_setting
toFALSE
indefaultFeedConfiguration()
? - 🇺🇸United States jgoodwill01
Any updates on this patch? Would love to have oath 2.0 feed imports!
- First commit to issue fork.
- last update
over 1 year ago 696 pass, 2 fail - 🇺🇸United States sclsweb
I'm trying to use this patch, entering all the credentials, but when attempting to import, I get:
The feed from https://example.libcal.com/1.1/events?cal_id=19407 seems to be broken because of error "Client error: `GET https://example.libcal.com/1.1/events?cal_id=19407` resulted in a `403 Forbidden` response: You do not have permission to perform this operation. ".
The same credentials work to get data in Postman (API endpoint URL, grant type, access token URL, client ID & secret). Is this an issue with the patch? Any advice for debugging?
- 🇺🇸United States sclsweb
Update: I changed the scope and it worked! There was a log message that didn't display on the import screen, that identified the scope as the problem.
- 🇺🇸United States sclsweb
Update: I changed the scope and it worked! There was a log message that didn't display on the import screen, that identified the scope as the problem.
Would love to see this ultimately committed. I have a production site that wants to use it.
- 🇺🇸United States Greg Boggs Portland Oregon
Different APIs require different scopes, Scope needs to be a configuration along side user and password.
- last update
7 months ago 715 pass, 2 fail - 🇨🇦Canada dylan donkersgoed London, Ontario
I merged in the latest 8.x-3.x branch. Rerolled patch for 8.x-3.0-beta4 attached as well.
- 🇺🇸United States Greg Boggs Portland Oregon
The patch needs a re-roll for Beta5
- 🇺🇸United States Greg Boggs Portland Oregon
The current patch makes oauth scope a required field. However, some APIs don't use Oauth scope. So this patch makes oauth scope optional. Still needs a reroll for Beta 5
- 🇺🇸United States Greg Boggs Portland Oregon
mucked up the patch file last time. trying again.
- 🇺🇸United States Greg Boggs Portland Oregon
Ok, apparently I have forgotten how to patch. This one will work, I think.
- 🇨🇦Canada dylan donkersgoed London, Ontario
I've fixed the conflicts in the MR. Also attaching a patch for the 3.0-rc2 version.
- 🇨🇦Canada dylan donkersgoed London, Ontario
That last patch doesn't work with composer, uploading another in diff format.
- 🇳🇱Netherlands megachriz
I see that the latest patch includes other changes that were made after rc2 (not related to this issue), like coding standard fixes. So it makes sense that the latest patch won't apply on rc3.