com.spotfire.server.security
Interface AuthenticationContext


public interface AuthenticationContext

The AuthenticationContext class contains information about the client and the network connection used by a client that needs to be authenticated. This information can be used by an Authenticator implementation to perform extra checks when authenticating the user, such as validating the client's IP number against a list of allowed hosts.

Since:
DSS 7.3

Method Summary
 Cookie[] getCookies()
          Returns an array containing all of the Cookie objects the client sent with this request.
 long getDateHeader(String name)
          Returns the value of the specified request header as a long value that represents a Date object.
 String getHeader(String name)
          Returns the value of the specified request header as a String.
 Enumeration getHeaderNames()
          Returns an Enumeration of all the header names this request contains.
 Enumeration getHeaders(String name)
          Returns all the values of the specified request header as an Enumeration of String objects.
 int getIntHeader(String name)
          Returns the value of the specified request header as an int.
 String getRemoteAddr()
          Returns the Internet Protocol (IP) address of the client that sent the request.
 String getRemoteHost()
          Returns the fully qualified name of the client that sent the request.
 String getServerName()
          Returns the host name of the server that received the request.
 int getServerPort()
          Returns the port number on which this request was received.
 boolean isSecure()
          Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
 

Method Detail

getRemoteAddr

String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR.

Returns:
a String containing the IP address of the client that sent the request

getRemoteHost

String getRemoteHost()
Returns the fully qualified name of the client that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address. For HTTP servlets, same as the value of the CGI variable REMOTE_HOST.

Returns:
a String containing the fully qualified name of the client

getServerName

String getServerName()
Returns the host name of the server that received the request. For HTTP servlets, same as the value of the CGI variable SERVER_NAME.

Returns:
a String containing the name of the server to which the request was sent

getServerPort

int getServerPort()
Returns the port number on which this request was received. For HTTP servlets, same as the value of the CGI variable SERVER_PORT.

Returns:
an integer specifying the port number

isSecure

boolean isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.

Returns:
a boolean indicating if the request was made using a secure channel

getCookies

Cookie[] getCookies()
Returns an array containing all of the Cookie objects the client sent with this request. This method returns null if no cookies were sent.

Returns:
an array of all the Cookies included with this request, or null if the request has no cookies

getDateHeader

long getDateHeader(String name)
Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such as If-Modified-Since.

The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.

If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.

Parameters:
name - a String specifying the name of the header
Returns:
a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the reqest
Throws:
IllegalArgumentException - If the header value can't be converted to a date

getHeader

String getHeader(String name)
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name

getHeaderNames

Enumeration getHeaderNames()
Returns an Enumeration of all the header names this request contains. If the request has no headers, this method returns an empty Enumeration.

Some servlet containers do not allow do not allow servlets to access headers using this method, in which case this method returns null.

Returns:
an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the servlet container does not allow servlets to use this method, null

getHeaders

Enumeration getHeaders(String name)
Returns all the values of the specified request header as an Enumeration of String objects.

Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.

If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name
Returns:
an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null

getIntHeader

int getIntHeader(String name)
Returns the value of the specified request header as an int. If the request does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException.

The header name is case insensitive.

Parameters:
name - a String specifying the name of a request header
Returns:
an integer expressing the value of the request header or -1 if the request doesn't have a header of this name
Throws:
NumberFormatException - If the header value can't be converted to an int


Copyright © 2000-2009 TIBCO Software Inc. All Rights Reserved.