NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sip.clientauthutils
Class AuthenticationHelperImpl

java.lang.Object
  extended by gov.nist.javax.sip.clientauthutils.AuthenticationHelperImpl
All Implemented Interfaces:
AuthenticationHelper

public class AuthenticationHelperImpl
extends Object
implements AuthenticationHelper

The class handles authentication challenges, caches user credentials and takes care (through the SecurityAuthority interface) about retrieving passwords.

Since:
2.0
Author:
Emil Ivov, Jeroen van Bemmel, M. Ranganathan

Constructor Summary
AuthenticationHelperImpl(SipStackImpl sipStack, AccountManager accountManager, HeaderFactory headerFactory)
          Default constructor for the security manager.
AuthenticationHelperImpl(SipStackImpl sipStack, SecureAccountManager accountManager, HeaderFactory headerFactory)
          Default constructor for the security manager.
 
Method Summary
 ClientTransaction handleChallenge(Response challenge, ClientTransaction challengedTransaction, SipProvider transactionCreator, int cacheTime)
          Uses securityAuthority to determinie a set of valid user credentials for the specified Response (Challenge) and appends it to the challenged request so that it could be retransmitted.
 void removeCachedAuthenticationHeaders(String callId)
          Remove cached entry.
 void setAuthenticationHeaders(Request request)
          Attach authentication headers to the given request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationHelperImpl

public AuthenticationHelperImpl(SipStackImpl sipStack,
                                AccountManager accountManager,
                                HeaderFactory headerFactory)
Default constructor for the security manager. There is one Account manager. There is one SipSecurity manager for every user name,

Parameters:
sipStack - -- our stack.
accountManger - -- an implementation of the AccountManager interface.
headerFactory - -- header factory.

AuthenticationHelperImpl

public AuthenticationHelperImpl(SipStackImpl sipStack,
                                SecureAccountManager accountManager,
                                HeaderFactory headerFactory)
Default constructor for the security manager. There is one Account manager. There is one SipSecurity manager for every user name,

Parameters:
sipStack - -- our stack.
accountManger - -- an implementation of the AccountManager interface.
headerFactory - -- header factory.
Method Detail

handleChallenge

public ClientTransaction handleChallenge(Response challenge,
                                         ClientTransaction challengedTransaction,
                                         SipProvider transactionCreator,
                                         int cacheTime)
                                  throws SipException,
                                         NullPointerException
Description copied from interface: AuthenticationHelper
Uses securityAuthority to determinie a set of valid user credentials for the specified Response (Challenge) and appends it to the challenged request so that it could be retransmitted.

Specified by:
handleChallenge in interface AuthenticationHelper
Parameters:
challenge - the 401/407 challenge response
challengedTransaction - the transaction established by the challenged request
transactionCreator - the JAIN SipProvider that we should use to create the new transaction.
Returns:
a transaction containing a reoriginated request with the necessary authorization header.
Throws:
SipException - if we get an exception white creating the new transaction
NullPointerException - if an argument or a header is null.

setAuthenticationHeaders

public void setAuthenticationHeaders(Request request)
Description copied from interface: AuthenticationHelper
Attach authentication headers to the given request. This looks up the credential cache and picks up any stored authentication headers for the given call ID and attaches it to the request.

Specified by:
setAuthenticationHeaders in interface AuthenticationHelper
Parameters:
request - - the request for which we attach the authentication headers.

removeCachedAuthenticationHeaders

public void removeCachedAuthenticationHeaders(String callId)
Description copied from interface: AuthenticationHelper
Remove cached entry.

Specified by:
removeCachedAuthenticationHeaders in interface AuthenticationHelper
Parameters:
callId - -- the call Id for which we want to remove the cached headers.

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.