Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package gov.nist.javax.sip.clientauthutils;
 
 
A helper interface that provides useful functionality for clients that need to authenticate with servers.

Author(s):
Emil Ivov
Jeroen van Bemmel
M. Ranganathan
Since:
2.0
public 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.

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.
cacheTime The amount of time (seconds ) for which the authentication helper will keep a reference to the generated credentials in a cache. If you specify -1, then the authentication credentials are cached until you remove them from the cache. If you choose this option, make sure you remove the cached headers or you will have a memory leak.
Returns:
a transaction containing a re-originated request with the necessary authorization header.
Throws:
javax.sip.SipException if we get an exception white creating the new transaction
java.lang.NullPointerException if an argument or a header is null.
    public abstract ClientTransaction handleChallenge(Response challenge,
            ClientTransaction challengedTransaction,
            SipProvider transactionCreatorint cacheTime ) throws SipException,
             NullPointerException;

    
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.

Parameters:
request - the request for which we attach the authentication headers.
    public abstract void setAuthenticationHeaders(Request request) ;

    
Remove cached entry.

Parameters:
callId -- the call Id for which we want to remove the cached headers.
    public abstract void removeCachedAuthenticationHeaders(String callId);
New to GrepCode? Check out our FAQ X