- Merge request !98Issue #3030847: Add support for feeds requiring OAuth 2.0 Authorization → (Open) created by prashantgajare
- 🇺🇸United States cainaru Potsdam, 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
about 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
22 days 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.