I've checked on debug, the parameter values are the same on SIP Communicator authentication:
//algorithm = MD5 //username_value = aryjunior //realm_value = asterisk //passwd = mypass //nonce_value = 0fceb3ee //nc_value = null //cnonce_value = null //method = REGISTER //digest_uri_value = sip:localhost;transport=udp //entity_body = //qop_value = null And on my UAC authentication: //algorithm = MD5 //username_value = aryjunior //realm_value = asterisk //passwd = mypass //nonce_value = 18e7217e //nc_value = null //cnonce_value = null //method = REGISTER //digest_uri_value = sip:localhost;transport=udp //entity_body = //qop_value = null Except by the nonce value... the nonce value for my UAC returned by the server on the first 404 response is no valid for timeout? I get the value from the SipListener.processResponse(ResponseEvent responseEvent), by: ... ClientTransaction clientTransaction = responseEvent.getClientTransaction(); Response responseClone = (Response)response.clone(); ... ListIterator authHeaders = responseClone.getHeaders( WWWAuthenticateHeader.NAME); ... WWWAuthenticateHeader authHeader = null; while (authHeaders.hasNext()) { authHeader = (WWWAuthenticateHeader) authHeaders.next(); String realm = authHeader.getRealm(); System.out.println("Autenticando em "+realm+" !!!"); } ... authorization.setNonce(authHeader.getNonce()); ... String responseStr = MessageDigestAlgorithm.calculateResponse( authHeader.getAlgorithm (), user.getUsername(), authHeader.getRealm(), user.getPassword(), authHeader.getNonce(), //TODO we should one day implement those two null-s null, //nc-value null, //cnonce requestClone.getMethod(), "sip:localhost;transport=udp", //requestClone.getRequestURI().toString(), "", authHeader.getQop()); authorization.setResponse(responseStr); ... And I'm sending a lite log file with the messages generated by the client and the asterisk server... Thanks very much!!! On 8/3/07, Pascal Maugeri <[EMAIL PROTECTED]> wrote: > > What are the parameter values your're passing to calculateResponse() ? > > I guess you know already: http://www.ietf.org/rfc/rfc2617.txt ? > > -pascal > > On 8/3/07, Ary Junior <[EMAIL PROTECTED]> wrote: > > Hi, Im trying to trace the SIP Communicator code for write my own User > Agent > > Client... using the same method MessageDigestAlgorithm.calculateResponse > (...) > > I cant receive the Response.OK message, I ever receive the > > Response.UNAUTHORIZED... > > inspecting the response string generated by the MD5 algorithm, I see > that > > the strings generated by SIP Communicator and my UAC are differents: > > > > > uri="sip:localhost;transport=udp",realm="asterisk",username="aryjunior",nonce="6ba75dcd",algorithm=MD5,response="9a8c664331efbe3836102c662ef133e4" > > > uri="sip:localhost;transport=udp",realm="asterisk",username="aryjunior",nonce="426e4388",algorithm=MD5,response="145dcd605d5a9543ed76c402e2fe6192" > > > > The response string depends the value thath authHeader.getNonce() method > > returns, then I replaced this value by any string and I get the same > string: > > > > > uri="sip:localhost;transport=udp",realm="asterisk",username="aryjunior",nonce="76687542",algorithm=MD5,response="241ee7aca9cb45fdc6489e6b8b88a3fd" > > > uri="sip:localhost;transport=udp",realm="asterisk",username="aryjunior",nonce="6cae08bf",algorithm=MD5,response="241ee7aca9cb45fdc6489e6b8b88a3fd" > > > > In this situation, naturally, both UACs cant login... any suggestion? > > > > Thanks very much!!! > > > > -- > > ----------------------------------------------------------------- > > Ary Junior > > Sun Certified Java Programmer - SCJP 1.4 > > Site: http://www.powerline.com.br/~aryjr/aryjr/ > > ----------------------------------------------------------------- > > _______________________________________________ > > Sip-implementors mailing list > > Sip-implementors@lists.cs.columbia.edu > > https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors > > > -- ----------------------------------------------------------------- Ary Junior Sun Certified Java Programmer - SCJP 1.4 Site: http://www.powerline.com.br/~aryjr/aryjr/ -----------------------------------------------------------------
_______________________________________________ Sip-implementors mailing list Sip-implementors@lists.cs.columbia.edu https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors