Package org.zoolu.sip.authentication

Examples of org.zoolu.sip.authentication.DigestAuthentication


      authHeader.addRealmParam(realm);
      authHeader.addNonceParam(nextNonce);
      authHeader.addUriParam(req.getRequestLine().getAddress().toString());
      authHeader.addQopParam(qop);
     
      String response = (new DigestAuthentication(SipMethods.REGISTER,
          authHeader, null, passwd)).getResponse();
      authHeader.addResponseParam(response);
     
      req.setAuthorizationHeader(authHeader);
    }
View Full Code Here


        req.removeViaHeader();
        via.setBranch(SipProvider.pickBranch());
        req.addViaHeader(via);
        qop = (qopOptions != null) ? "auth" : null;

        DigestAuthentication digest = new DigestAuthentication(SipMethods.REGISTER,
            req.getRequestLine().getAddress().toString(), wwwAuthHeader, qop, null, username, passwd);
       
        AuthorizationHeader authHeader;
        if (code == 401)
          authHeader = digest.getAuthorizationHeader();
        else
          authHeader = digest.getProxyAuthorizationHeader();

        req.setAuthorizationHeader(authHeader);
        TransactionClient t = new TransactionClient(sipProvider, req, this);
        t.request();
View Full Code Here

         ah.addUsernameParam(username);
         ah.addRealmParam(realm);
         ah.addNonceParam(next_nonce);
         ah.addUriParam(req.getRequestLine().getAddress().toString());
         ah.addQopParam(qop);
         String response=(new DigestAuthentication(SipMethods.REGISTER,ah,null,passwd)).getResponse();
         ah.addResponseParam(response);
         req.setAuthorizationHeader(ah);
      }
      if (expire_time>0) printLog("Registering contact "+contact+" (it expires in "+expire_time+" secs)",LogLevel.HIGH);
      else printLog("Unregistering contact "+contact,LogLevel.HIGH);
View Full Code Here

            req.setCSeqHeader(req.getCSeqHeader().incSequenceNumber());
            WwwAuthenticateHeader wah=resp.getWwwAuthenticateHeader();
            String qop_options=wah.getQopOptionsParam();
            //printLog("DEBUG: qop-options: "+qop_options,LogLevel.MEDIUM);
            qop=(qop_options!=null)? "auth" : null;
            AuthorizationHeader ah=(new DigestAuthentication(SipMethods.REGISTER,req.getRequestLine().getAddress().toString(),wah,qop,null,username,passwd)).getAuthorizationHeader();
            req.setAuthorizationHeader(ah);
            TransactionClient t=new TransactionClient(sip_provider,req,this);
            t.request();
         }
         else
View Full Code Here

      authHeader.addRealmParam(realm);
      authHeader.addNonceParam(nextNonce);
      authHeader.addUriParam(req.getRequestLine().getAddress().toString());
      authHeader.addQopParam(qop);
     
      String response = (new DigestAuthentication(SipMethods.REGISTER,
          authHeader, null, passwd)).getResponse();
      authHeader.addResponseParam(response);
     
      req.setAuthorizationHeader(authHeader);
    }
View Full Code Here

        req.removeViaHeader();
        via.setBranch(SipProvider.pickBranch());
        req.addViaHeader(via);
        qop = (qopOptions != null) ? "auth" : null;

        DigestAuthentication digest = new DigestAuthentication(SipMethods.REGISTER,
            req.getRequestLine().getAddress().toString(), wwwAuthHeader, qop, null, username, passwd);
       
        AuthorizationHeader authHeader;
        if (code == 401)
          authHeader = digest.getAuthorizationHeader();
        else
          authHeader = digest.getProxyAuthorizationHeader();

        req.setAuthorizationHeader(authHeader);
        TransactionClient t = new TransactionClient(sipProvider, req, this);
        t.request();
View Full Code Here

        
         if (authentication_service.hasUser(user))
         { 
            if (authentication_scheme.equalsIgnoreCase(scheme))
            { 
               DigestAuthentication auth=new DigestAuthentication(msg.getRequestLine().getMethod(),ah,null,keyToPasswd(authentication_service.getUserKey(user)));

               // check user's authentication response
               boolean is_authorized=auth.checkResponse();

               rand=pickRandBytes();       
                 
               if (!is_authorized)
               {  // authentication/authorization failed
View Full Code Here

         if (code==401) wah=msg.getWwwAuthenticateHeader();
         else wah=msg.getProxyAuthenticateHeader();
         String qop_options=wah.getQopOptionsParam();
         qop=(qop_options!=null)? "auth" : null;
         RequestLine rl=req.getRequestLine();
         DigestAuthentication digest=new DigestAuthentication(rl.getMethod(),rl.getAddress().toString(),wah,qop,null,username,passwd);
         AuthorizationHeader ah;
         if (code==401) ah=digest.getAuthorizationHeader();
         else ah=digest.getProxyAuthorizationHeader();
         req.setAuthorizationHeader(ah);

         if (req.isInvite()) // make sure it's an invite
                this.invite_req=req; // must track last invite so cancel will work correctly - fixes 503 from asterisk on cancel
View Full Code Here

TOP

Related Classes of org.zoolu.sip.authentication.DigestAuthentication

Copyright © 2018 www.massapicom. 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.