public static void saveAuthentication(String url, boolean isCluster,
			final String authenticationToken, final boolean authenticationTokenIsPrivate,
			final String applicationKey, final int timeToLive, final String privateKey,
			final Map<String, ChannelPermissions> permissions,
			final OnRestWebserviceResponse onCompleted) throws IOException,
			InvalidBalancerServerException,
			OrtcAuthenticationNotAuthorizedException {
		
		HashMap<String, LinkedList<ChannelPermissions>> permissionsMap = new HashMap<String, LinkedList<ChannelPermissions>>();

		Set<String> channels = permissions.keySet();
		for (String channelName : channels) {
			LinkedList<ChannelPermissions> channelPermissionList = new LinkedList<ChannelPermissions>();
			channelPermissionList.add(permissions.get(channelName));
			permissionsMap.put(channelName, channelPermissionList);
		}
		
		saveAuthentication(url, isCluster, authenticationToken, authenticationTokenIsPrivate, applicationKey, timeToLive, privateKey, permissionsMap, onCompleted);
	}
public static void saveAuthentication ( String url , boolean isCluster , final String authenticationToken , final boolean authenticationTokenIsPrivate , final String applicationKey , final int timeToLive , final String privateKey , final Map < String , ChannelPermissions > permissions , final OnRestWebserviceResponse onCompleted ) throws IOException , InvalidBalancerServerException , OrtcAuthenticationNotAuthorizedException { HashMap < String , LinkedList < ChannelPermissions > > permissionsMap = new HashMap < String , LinkedList < ChannelPermissions > > ( ) ; Set < String > channels = permissions . keySet ( ) ; for ( String channelName : channels ) { LinkedList < ChannelPermissions > channelPermissionList = new LinkedList < ChannelPermissions > ( ) ; channelPermissionList . add ( permissions . get ( channelName ) ) ; permissionsMap . put ( channelName , channelPermissionList ) ; } saveAuthentication ( url , isCluster , authenticationToken , authenticationTokenIsPrivate , applicationKey , timeToLive , privateKey , permissionsMap , onCompleted ) ; }
Asynchronously saves the authentication token channels permissions in the ORTC server.

<pre>
HashMap&lt;String, ChannelPermissions&gt; permissions = new HashMap&lt;String, ChannelPermissions&gt;();
permissions.put(&quot;channel1:*&quot;, ChannelPermissions.Write);
permissions.put(&quot;channel1&quot;, ChannelPermissions.Write);

if (!Ortc.saveAuthentication(&quot;http://ortc-developers.realtime.co/server/2.1/&quot;,
true, &quot;SessionId&quot;, false, &quot;APPKEY&quot;, 1800, &quot;PVTKEY&quot;, permissions)) {
throw new Exception(&quot;Was not possible to authenticate&quot;);
}
</pre>

@param url
Ortc Server Url
@param isCluster
Indicates whether the ORTC server is in a cluster.
@param authenticationToken
Authentication Token which is generated by the application
server, for instance a unique session ID.
@param authenticationTokenIsPrivate
Indicates whether the authentication token is private (true)
or not (false)
@param applicationKey
Application Key that was provided to you together with the
ORTC service purchasing.
@param timeToLive
The authentication token time to live, in other words, the
allowed activity time (in seconds).
@param privateKey
The private key provided to you together with the ORTC service
purchasing.
@param permissions
The channels and their permissions (w: write/read or r: read
or p: presence, case sensitive).
@param onCompleted
The callback that is executed after the save authentication is completed
@throws ibt.ortc.api.OrtcAuthenticationNotAuthorizedException