Package org.cipango.sip.security

Examples of org.cipango.sip.security.Authenticate


  {
    List<String> list = new ArrayList<String>();
    ListIterator<String > it = _fields.getValues(SipHeaders.WWW_AUTHENTICATE_BUFFER);
    while (it.hasNext())
    {
      Authenticate authenticate = new Authenticate(it.next());
      list.add(authenticate.getParameter(Authenticate.REALM_BUFFER));
    }
    it = _fields.getValues(SipHeaders.PROXY_AUTHENTICATE_BUFFER);
    while (it.hasNext())
    {
      Authenticate authenticate = new Authenticate(it.next());
      list.add(authenticate.getParameter(Authenticate.REALM_BUFFER));
    }
    return list.iterator();
  }
View Full Code Here


  public void addAuthHeader(SipServletResponse challengeResponse, AuthInfo authInfo)
  {
    ListIterator<String> authenticates = challengeResponse.getHeaders(SipHeaders.WWW_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      AuthElement element = ((AuthInfoImpl) authInfo).getAuthElement(challengeResponse.getStatus(), authenticate.getRealm());
      Authorization authorization =
        new Authorization(authenticate, element.getUsername(), element.getPassword(), getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.AUTHORIZATION, authorization.toString());
    }
    authenticates = challengeResponse.getHeaders(SipHeaders.PROXY_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      AuthElement element = ((AuthInfoImpl) authInfo).getAuthElement(challengeResponse.getStatus(), authenticate.getRealm());
      Authorization authorization =
        new Authorization(authenticate, element.getUsername(), element.getPassword(), getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.PROXY_AUTHORIZATION, authorization.toString());
    }
  }
View Full Code Here

  public void addAuthHeader(SipServletResponse challengeResponse, String username, String password)
  {
    ListIterator<String> authenticates = challengeResponse.getHeaders(SipHeaders.WWW_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      Authorization authorization =
        new Authorization(authenticate, username, password, getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.AUTHORIZATION, authorization.toString());
    }
    authenticates = challengeResponse.getHeaders(SipHeaders.PROXY_AUTHENTICATE);
    while (authenticates.hasNext())
    {
      Authenticate authenticate = new Authenticate(authenticates.next());
      Authorization authorization =
        new Authorization(authenticate, username, password, getRequestURIAsString(), getMethod());
      addHeader(SipHeaders.PROXY_AUTHORIZATION, authorization.toString());
    }
  }
View Full Code Here

TOP

Related Classes of org.cipango.sip.security.Authenticate

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.