 	import com.hurlant.util.Base64;
 	import com.hurlant.util.Hex;
 
-	import flash.net.URLVariables;
 	import flash.utils.ByteArray;
+	import flash.utils.Dictionary;
 
 	import org.igniterealtime.xiff.core.XMPPConnection;
 

		override public function handleChallenge( stage:int, challenge:XML ):XML
		{
			var decodedChallenge:String = Base64.decode( challenge );
			decodedChallenge = decodedChallenge.split( "," ).join( "&" ).replace( /\"/g, "");
			var challengeMap:URLVariables = new URLVariables( decodedChallenge );
			var responseMap:URLVariables = new URLVariables();

			responseMap.username = connection.username;
			responseMap.realm = challengeMap.realm ? challengeMap.realm : connection.domain;
			responseMap.nonce = challengeMap.nonce;
			responseMap.cnonce = new Date().time;
			responseMap.nc = "00000001";
			responseMap.qop = challengeMap.qop;
			responseMap[ "digest-uri" ] = "xmpp/" + responseMap.realm;
			responseMap.charset = challengeMap.charset;
			responseMap.response = formatResponse( responseMap );

			var challengeResponse:String = "username=\"" + responseMap.username + "\"";
			challengeResponse += ",realm=\"" + responseMap.realm + "\"";
			challengeResponse += ",nonce=\"" + responseMap.nonce + "\"";
			challengeResponse += ",cnonce=\"" + responseMap.cnonce + "\"";
			challengeResponse += ",nc=" + responseMap.nc;
			challengeResponse += ",qop=" + responseMap.qop;
			challengeResponse += ",digest-uri=\"" + responseMap[ "digest-uri" ] + "\"";
			challengeResponse += ",response=" + responseMap.response;
			challengeResponse += ",charset=" + responseMap.charset;
			challengeResponse = Base64.encode( challengeResponse );
			var resp:XML = response;
			resp.setNamespace( DigestMD5.NS );
			resp.setChildren( challengeResponse );
			return resp;
		}


		*/
		override public function handleResponse( stage:int, response:XML ):Object
		{
			var success:Boolean = response.localName() == "success";
			return {
				authComplete: true,
				authSuccess: success,
