-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong validation on accountSid when using API Sid/Api Key to initialize the client #600
Comments
This is similar to twilio/twilio-csharp#531, but the Node lib is also expecting an account SID in this case. The fix is to include the account SID in optional params. E.g.: twilio(apiSid, apiKey, { accountSid }); |
@childish-sambino Yes, this is my work-around too. I can even use a dummy value of accountSid to bypass the validation. E.g.:
However, I still get a feeling that this is a bug in the twilio node library, as the document mentions that |
Probably need a similar implementation here as twilio/twilio-csharp#533 This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog. |
I believe this is an important issue to address, even if just to update the error message thrown to explain the different requirements for API Keys. At present, I understand that this behaviour is not described in the documentation. Because the error thrown suggests that API Keys cannot be used instead of account auth tokens, developers are encouraged to avoid using API Keys, which is poor practice. If the account SID begins with "SK", a different error message could be provided:
|
The solution is very easy, when you should use the Account SID you would verify this account start by AC |
To better illustrate that an Account SID is required when using an API key to init the client. Fixes #600
Fixed by #828 |
Issue Summary
When initialize the client using API Sid/Key, validation still applied to the username field which will check if the field starts with 'AC'. But API Sid should start with 'SK'.
Steps to Reproduce
Initialize the twilio SDK client using API Sid/Key
Code Snippet
Exception/Log
Technical details:
The text was updated successfully, but these errors were encountered: