0
Uri.Builder b = Uri.parse(TOKEN_SERVICE_URL).buildUpon();
        if (newClientProfile.isAllowOutgoing()) {
            b.appendQueryParameter("allowOutgoing", newClientProfile.allowOutgoing ? "true" : "false");
        }
        if (newClientProfile.isAllowIncoming() && newClientProfile.getName() != null) {
            b.appendQueryParameter("client", newClientProfile.getName());
        }

        Ion.with(getApplicationContext())
                .load(b.toString())
                .asString()
                .setCallback(new FutureCallback<String>() {
                    @Override
                    public void onCompleted(Exception e, String capabilityToken) {

I got the capability token from my web service, In twilio quickstart example they are using TOKEN_SERVICE_URL to generate a token. Now I don't know how to use this method to validate clientProfile with the capabilities inside the token. Please help me

jrbedard
  • 3,662
  • 5
  • 30
  • 34

1 Answers1

0

Twilio developer evangelist here.

You will be able to find the application server here. Basically it is a way for your application to authenticate with Twilio using a backend webserver instead of holding your API credentials.

Here's an article that examplins how the capability tokens work, and will show you how to mudify the application linked in case you want to have fine grain control over the capabilities.

Hope this helps you.

Marcos Placona
  • 21,468
  • 11
  • 68
  • 93
  • What if i want to use the server for multiple clients, because of this i cant hard code the API credentials inside he python server. Thanks – AndroidDev Nov 23 '16 at 15:37
  • In that case I would suggest having logic in your backend server to create the capability token depending on a key you passed from the app. So your app would pass something like "TOKEN_SERVICE_URL?cust=1", and then your backend server could go on the database and fetch key information from customer 1 and return an authorisation for that specific customer. – Marcos Placona Nov 23 '16 at 15:52