public class TwilioCapability extends CapabilityToken
CapabilityToken.DomainException
Constructor and Description |
---|
TwilioCapability(String accountSid,
String authToken)
Create a new TwilioCapability with zero permissions.
|
Modifier and Type | Method and Description |
---|---|
void |
allowClientIncoming(String clientName)
If the user of this token should be allowed to accept incoming
connections then configure the TwilioCapability through this method and
specify the client name.
|
void |
allowClientOutgoing(String appSid)
Allow the user of this token to make outgoing connections.
|
void |
allowClientOutgoing(String appSid,
Map<String,String> params)
Allow the user of this token to make outgoing connections.
|
void |
allowEventStream(Map<String,String> filters)
Allow the user of this token to access their event stream.
|
String |
generateToken()
Generates a new token based on the credentials and permissions that
previously has been granted to this token.
|
String |
generateToken(long ttl)
Generates a new token based on the credentials and permissions that
previously has been granted to this token.
|
public TwilioCapability(String accountSid, String authToken)
accountSid
- the account sid to which this token is granted accessauthToken
- the secret key used to sign the token. Note, this auth token
is not visible to the user of the token.public void allowClientOutgoing(String appSid)
appSid
- the application to which this token grants accesspublic void allowClientOutgoing(String appSid, Map<String,String> params)
appSid
- the application to which this token grants accessparams
- signed parameters that the user of this token cannot
overwrite.public void allowClientIncoming(String clientName)
clientName
- name of the Twilio Clientpublic void allowEventStream(Map<String,String> filters)
filters
- key/value filters to apply to the event streampublic String generateToken() throws CapabilityToken.DomainException
DomainException
- if unable to generate tokenCapabilityToken.DomainException
public String generateToken(long ttl) throws CapabilityToken.DomainException
ttl
- the number of seconds before this token expiresDomainException
- if unable to generate tokenCapabilityToken.DomainException
Copyright © 2011 Twilio, Inc. All Rights Reserved.