- Issue created by @AlfTheCat
- 🇮🇳India nanny1979
I am getting the same error with D9. SMS is successful with the CURL. When we try the same via the module, it is throwing the authorization error.
- 🇮🇳India shashank5563 New Delhi
@nanny1979,
Please follow the installation instruction.
Installation1. Drupal 8,9 & 10: Add the library via the composer composer require twilio/sdk
2. Visit 'admin/config/system/twilio' and enter your Twilio account SID, Auth Token, and Phone number found on the Twilio dashboard - 🇮🇳India SenthilMohith Chennai
shashank5563,
Still we are able to get this error "[HTTP 401] Unable to create record: Authentication Error - invalid username", if the Key → module is installed. In the Twilio Settings admin form (/admin/config/system/twilio), Twilio Account SID and Twilio authentication token information stored as a key. Due to this valid SID and Token not passed correctly via Twilio REST Client.
File: /twilio/src/Form/TwilioAdminForm.php
Line no: 94$key_exists = $this->moduleHandler->moduleExists('key'); if ($key_exists) { $form['account'] = [ '#type' => 'key_select', '#required' => TRUE, '#default_value' => $config->get('account'), '#title' => $this->t('Twilio Account SID'), ]; $form['token'] = [ '#type' => 'key_select', '#required' => TRUE, '#default_value' => $config->get('token'), '#title' => $this->t('Twilio authentication token'), ]; }
Proposed solution: We should get the valid SID and Token from the selected keys.
- Status changed to Needs review
over 1 year ago 9:24am 9 August 2023 - 🇮🇳India SenthilMohith Chennai
@shashank5563,
Created a patch to get the Valid SID and token from the key configurations. Kindly validate from your end and confirm.
- Status changed to RTBC
over 1 year ago 7:57am 11 August 2023 - 🇮🇳India nanny1979
Reviewed the patch provided in #6 and I am able to test the SMS successfully as expected
- Status changed to Fixed
over 1 year ago 7:57am 14 August 2023 - Status changed to Fixed
over 1 year ago 7:58am 14 August 2023