Skip to content
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

Support API Key Auth #58

Open
threez opened this issue May 22, 2020 · 5 comments
Open

Support API Key Auth #58

threez opened this issue May 22, 2020 · 5 comments

Comments

@threez
Copy link

threez commented May 22, 2020

Hello,

I needed the authentication with API key and token. For that I made these adjustments to the NewClient:

func NewClient(accountSid string, apikey string, authToken string, httpClient *http.Client) *Client {
	if httpClient == nil {
		httpClient = defaultHttpClient
	}
	restClient := rest.NewClient(apikey, authToken, BaseURL)

Maybe you want to support this in your library.

@kevinburke
Copy link
Owner

Thanks, this is a new feature, I tried to make heads or tails of it and can't figure out how it's integrated with Twilio's existing tools.

The trick is to use the API key for authentication but keep the account SID in the URL. I want to see how the current client libraries manage this before adding support for it and I can't figure out how they currently do it.

@kevinburke
Copy link
Owner

I understand what's going on now but the change is going to be slightly more involved and as a result it's gonna take me a little bit of time.

@threez
Copy link
Author

threez commented May 23, 2020

Take your time, I have a solution for the moment. Thanks for your efforts

@bconway
Copy link

bconway commented May 11, 2021

It would be great to have this support. As teams grow, slinging around the primary account SID and auth token is less than ideal.

It looks like other libraries are passing in the API key, secret, and account SID: twilio/twilio-node#600

Thanks!

@saniales
Copy link

saniales commented Oct 12, 2021

Take your time, I have a solution for the moment. Thanks for your efforts

since this has no answer, can you share your workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants