Examples of ProxyAuthenticateHeader


Examples of javax.sip.header.ProxyAuthenticateHeader

      // Now can begin to build the authentication header using a MD5
      // digest scheme
      WWWAuthenticateHeader wwwAuthenticateHeader = (WWWAuthenticateHeader) response
          .getHeader(WWWAuthenticateHeader.NAME);
      ProxyAuthenticateHeader proxyAuthenticateHeader = (ProxyAuthenticateHeader) response
          .getHeader(ProxyAuthenticateHeader.NAME);

      String realm = null;
      String nonce = null;
      // Check whether we've received an wwwAuthenticationHeader
      // or a ProxyAuthenticationHeader from the proxy server
      if (wwwAuthenticateHeader != null) {
        if (log.isDebugEnabled()) {
          log.debug("wwwAuthenticateHeader found!");
        }
        // Retrieve the realm from the authentication header
        realm = wwwAuthenticateHeader.getRealm();
        // Retrieve the nonce from the wwwAuthenticateHeader
        nonce = wwwAuthenticateHeader.getNonce();

      } else if (proxyAuthenticateHeader != null) {
        if (log.isDebugEnabled()) {
          log.debug("ProxyAuthenticateHeader found!");
        }
        // Retrieve the realm from the authentication header
        realm = proxyAuthenticateHeader.getRealm();
        // Retrieve the nonce from the wwwAuthenticateHeader
        nonce = proxyAuthenticateHeader.getNonce();
      } else {
        if (log.isDebugEnabled()) {
          log
              .debug("Neither a ProxyAuthenticateHeader or AuthorizationHeader found!");
        }
View Full Code Here

Examples of org.zoolu.sip.header.ProxyAuthenticateHeader

         if (type==SERVER_AUTHENTICATION) result=401; // response code 401 ("Unauthorized")
         else result=407; // response code 407 ("Proxy Authentication Required")
         err_resp=MessageFactory.createResponse(msg,result,SipResponses.reasonOf(result),null);
         WwwAuthenticateHeader wah;
         if (type==SERVER_AUTHENTICATION) wah=new WwwAuthenticateHeader("Digest");
         else wah=new ProxyAuthenticateHeader("Digest");
         wah.addRealmParam(realm);
         wah.addQopOptionsParam(qop_options);
         wah.addNonceParam(HEX(rand));
         err_resp.setWwwAuthenticateHeader(wah);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.