twilio java connection with proxy authentication

后端 未结 1 1422
甜味超标
甜味超标 2021-01-25 06:19

I am setting up a java Twilio connection using the example Twilio java-sdk from the api examples here.

The only difference is I need to run my Twilio connection through

相关标签:
1条回答
  • 2021-01-25 07:09

    Resolved... just needed to add another set of credentials that were scoped to api.twilio.com after the proxy credentials:

        //Set up Proxy user credentials
        CredentialsProvider credsProvider = new BasicCredentialsProvider();
        credsProvider.setCredentials(
                new AuthScope(PROXY_ADDRESS, PROXY_PORT), 
                new UsernamePasswordCredentials(PROXY_USER, PROXY_PASSWORD));
    
        //Set up Twilio user credentials
        credsProvider.setCredentials(
                new AuthScope("api.twilio.com", 443), 
                new UsernamePasswordCredentials(ACCOUNT_SID, AUTH_TOKEN));
    

    I'll leave this here for posterity because there has been several questions about this but no accepted answers.

    0 讨论(0)
提交回复
热议问题