JSIP API v1.2
November 2006

javax.sip.header
Interface AuthorizationHeader

All Superinterfaces:
java.lang.Cloneable, Header, Parameters, java.io.Serializable
All Known Subinterfaces:
ProxyAuthorizationHeader

public interface AuthorizationHeader
extends Parameters, Header

The Authorization header is used when a user agent wishes to authenticate itself with a server - usually, but not necessarily, after receiving an UNAUTHORIZED Response - by including an AuthorizationHeader with the Request. The AuthorizationHeader consists of credentials containing the authentication information of the user agent for the realm of the resource being requested.

This header field, along with Proxy-Authorization, breaks the general rules about multiple header field values. Although not a comma- separated list, this header field name may be present multiple times, and MUST NOT be combined into a single header line.

For Example:
Authorization: Digest username="Alice", realm="atlanta.com",
nonce="84a4cc6f3082121f32b42a2187831a9e",
response="7587245234b3434cc3412213e5f113a5432"

Author:
BEA Systems, NIST
See Also:
Parameters, WWWAuthenticateHeader, ProxyAuthorizationHeader

Field Summary
static java.lang.String NAME
          Name of AuthorizationHeader
 
Method Summary
 java.lang.String getAlgorithm()
          Returns the Algorithm value of this AuthorizationHeader.
 java.lang.String getCNonce()
          Returns the CNonce value of this AuthorizationHeader.
 java.lang.String getNonce()
          Returns the Nonce value of this AuthorizationHeader.
 int getNonceCount()
          Returns the Nonce Count value of this AuthorizationHeader.
 java.lang.String getOpaque()
          Returns the Opaque value of this AuthorizationHeader.
 java.lang.String getQop()
          Returns the Qop value of this AuthorizationHeader.
 java.lang.String getRealm()
          Returns the Realm value of this AuthorizationHeader.
 java.lang.String getResponse()
          Returns the Response value of this AuthorizationHeader.
 java.lang.String getScheme()
          Returns the scheme of the Response information for this AuthorizationHeader.
 URI getURI()
          Returns the DigestURI value of this AuthorizationHeader.
 java.lang.String getUsername()
          Returns the Username value of this AuthorizationHeader.
 void setAlgorithm(java.lang.String algorithm)
          Sets the Algorithm of the AuthorizationHeader to the new algorithm parameter value.
 void setCNonce(java.lang.String cNonce)
          Sets the CNonce of the AuthorizationHeader to the cNonce parameter value.
 void setNonce(java.lang.String nonce)
          Sets the Nonce of the AuthorizationHeader to the nonce parameter value.
 void setNonceCount(int nonceCount)
          Sets the Nonce Count of the AuthorizationHeader to the nonceCount parameter value.
 void setOpaque(java.lang.String opaque)
          Sets the Opaque value of the AuthorizationHeader to the new opaque parameter value.
 void setQop(java.lang.String qop)
          Sets the MessageQop value of the AuthorizationHeader to the new qop parameter value.
 void setRealm(java.lang.String realm)
          Sets the Realm of the AuthorizationHeader to the realm parameter value.
 void setResponse(java.lang.String response)
          Sets the Response of the AuthorizationHeader to the new response parameter value.
 void setScheme(java.lang.String scheme)
          Sets the scheme of the Response information for this AuthorizationHeader.
 void setURI(URI uri)
          Sets the URI of the AuthorizationHeader to the uri parameter value.
 void setUsername(java.lang.String username)
          Sets the Username of the AuthorizationHeader to the username parameter value.
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, hashCode, toString
 

Field Detail

NAME

static final java.lang.String NAME
Name of AuthorizationHeader

See Also:
Constant Field Values
Method Detail

setScheme

void setScheme(java.lang.String scheme)
Sets the scheme of the Response information for this AuthorizationHeader. For example, Digest.

Parameters:
scheme - - the new string value that identifies the response information scheme.

getScheme

java.lang.String getScheme()
Returns the scheme of the Response information for this AuthorizationHeader.

Returns:
the string value of the response information.

setRealm

void setRealm(java.lang.String realm)
              throws java.text.ParseException
Sets the Realm of the AuthorizationHeader to the realm parameter value. Realm strings MUST be globally unique. It is RECOMMENDED that a realm string contain a hostname or domain name. Realm strings SHOULD present a human-readable identifier that can be rendered to a user.

Parameters:
realm - the new Realm String of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the realm.

getRealm

java.lang.String getRealm()
Returns the Realm value of this AuthorizationHeader. This convenience method returns only the realm of the complete Response.

Returns:
the String representing the Realm information, null if value is not set.

setUsername

void setUsername(java.lang.String username)
                 throws java.text.ParseException
Sets the Username of the AuthorizationHeader to the username parameter value.

Parameters:
username - the new Username String of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the username.

getUsername

java.lang.String getUsername()
Returns the Username value of this AuthorizationHeader. This convenience method returns only the username of the complete Response.

Returns:
the String representing the Username information, null if value is not set.

setNonce

void setNonce(java.lang.String nonce)
              throws java.text.ParseException
Sets the Nonce of the AuthorizationHeader to the nonce parameter value.

Parameters:
nonce - - the new nonce String of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the nonce value.

getNonce

java.lang.String getNonce()
Returns the Nonce value of this AuthorizationHeader.

Returns:
the String representing the nonce information, null if value is not set.

setURI

void setURI(URI uri)
Sets the URI of the AuthorizationHeader to the uri parameter value.

Parameters:
uri - - the new URI of this AuthorizationHeader.

getURI

URI getURI()
Returns the DigestURI value of this AuthorizationHeader.

Returns:
the URI representing the URI information, null if value is not set.

setResponse

void setResponse(java.lang.String response)
                 throws java.text.ParseException
Sets the Response of the AuthorizationHeader to the new response parameter value.

Parameters:
response - - the new response String of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the Response.

getResponse

java.lang.String getResponse()
Returns the Response value of this AuthorizationHeader.

Returns:
the String representing the Response information.

setAlgorithm

void setAlgorithm(java.lang.String algorithm)
                  throws java.text.ParseException
Sets the Algorithm of the AuthorizationHeader to the new algorithm parameter value.

Parameters:
algorithm - - the new algorithm String of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the algorithm value.

getAlgorithm

java.lang.String getAlgorithm()
Returns the Algorithm value of this AuthorizationHeader.

Returns:
the String representing the Algorithm information, null if the value is not set.

setCNonce

void setCNonce(java.lang.String cNonce)
               throws java.text.ParseException
Sets the CNonce of the AuthorizationHeader to the cNonce parameter value.

Parameters:
cNonce - - the new cNonce String of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the cNonce value.

getCNonce

java.lang.String getCNonce()
Returns the CNonce value of this AuthorizationHeader.

Returns:
the String representing the cNonce information, null if value is not set.

setOpaque

void setOpaque(java.lang.String opaque)
               throws java.text.ParseException
Sets the Opaque value of the AuthorizationHeader to the new opaque parameter value.

Parameters:
opaque - - the new Opaque string of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the opaque value.

getOpaque

java.lang.String getOpaque()
Returns the Opaque value of this AuthorizationHeader.

Returns:
the String representing the Opaque information, null if the value is not set.

setQop

void setQop(java.lang.String qop)
            throws java.text.ParseException
Sets the MessageQop value of the AuthorizationHeader to the new qop parameter value.

Parameters:
qop - - the new Qop string of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the Qop value.

getQop

java.lang.String getQop()
Returns the Qop value of this AuthorizationHeader.

Returns:
the string representing the Qop information, null if the value is not set.

setNonceCount

void setNonceCount(int nonceCount)
                   throws java.text.ParseException
Sets the Nonce Count of the AuthorizationHeader to the nonceCount parameter value.

Parameters:
nonceCount - - the new nonceCount integer of this AuthorizationHeader.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the nonceCount value.

getNonceCount

int getNonceCount()
Returns the Nonce Count value of this AuthorizationHeader.

Returns:
the integer representing the nonceCount information, -1 if value is not set.

JSIP API v1.2
November 2006

If you have any comments, please mail them to JAIN-SIP-INTEREST@java.sun.com after subscribing at http://archives.java.sun.com
Copyright - 2006 BEA Systems and Sun Microsystems