com.pcbsys.nirvana.client.nUserAuthentication Class Reference

The nUserAuthentication class provides the ability to perform basic HTTP athentication to a nirvana realm running a file plugin with authentication turned on. More...

Public Member Functions

String getAuthUser ()
 Obtain the username as returned from the server authentication. More...
 
String getDescription ()
 Obtain the description associated with the authenticated user. More...
 
String[] getGroupDescription ()
 Obtain the list of authorized group descriptions to which this user belongs, as denoted by the chosen authenticator on the realm plugin. More...
 
int[] getGroupId ()
 Obtain the list of authorized group ids to which this user belongs, as denoted by the chosen authenticator on the realm plugin. More...
 
String[] getGroupName ()
 Obtain the list of authorized groups to which this user belongs, as denoted by the chosen authenticator on the realm plugin. More...
 
String getHomeId ()
 Obtain the home group of the authenticated user. More...
 
BitSet getPermissions ()
 Obtain the BitSet representing the permissions allocated to this user. More...
 
String getToken ()
 Obtain the token generated by the server if one was requested. More...
 
String getUsername ()
 Obtain the username passed into the authentication. More...
 
boolean isValid ()
 Determine whether authentication was successful. More...
 
 nUserAuthentication (URLConnection urlConnection) throws IOException
 Construct the authentication with a url connection in order to extract the information required. More...
 
 nUserAuthentication (String username, String password, String authUrl) throws IOException
 Construct the authentication with as user name, password and the URL of the authenticating Nirvana plugin This will use BASIC auth mode. More...
 
 nUserAuthentication (String username, String password, String authUrl, int authType) throws IOException
 Construct the authentication with as user name, password and the URL of the authenticating Nirvana plugin. More...
 
 nUserAuthentication (String username, String password, String authUrl, int authType, boolean requestToken) throws IOException
 Construct the authentication with as user name, password and the URL of the authenticating Nirvana plugin. More...
 

Static Public Attributes

static final int BASIC = 0
 Use BASIC HTTP authentication.
 
static final int DIGEST = 1
 Use DIGEST based HTTP authentication.
 
static final int FORM = 2
 Use FORM based HTTP POST authentication.
 

Detailed Description

The nUserAuthentication class provides the ability to perform basic HTTP athentication to a nirvana realm running a file plugin with authentication turned on.

Constructor & Destructor Documentation

com.pcbsys.nirvana.client.nUserAuthentication.nUserAuthentication ( URLConnection  urlConnection) throws IOException

Construct the authentication with a url connection in order to extract the information required.

Parameters
urlConnectionthe url connection established to extract the information for authentication
Exceptions
IOExceptionthrown should there be any problems authenticating or accessing the url
com.pcbsys.nirvana.client.nUserAuthentication.nUserAuthentication ( String  username,
String  password,
String  authUrl 
) throws IOException

Construct the authentication with as user name, password and the URL of the authenticating Nirvana plugin This will use BASIC auth mode.

Parameters
usernamethe username to be authenticated
passwordthe password to use for authentication
authUrlthe url to use for the authentication
Exceptions
IOExceptionthrown should there be any problems authenticating or accessing the url
com.pcbsys.nirvana.client.nUserAuthentication.nUserAuthentication ( String  username,
String  password,
String  authUrl,
int  authType 
) throws IOException

Construct the authentication with as user name, password and the URL of the authenticating Nirvana plugin.

Parameters
usernamethe username to be authenticated
passwordthe password to use for authentication
authUrlthe url to use for the authentication
authTypethe type of authentication to use (BASIC/DIGEST)
Exceptions
IOExceptionthrown should there be any problems authenticating or accessing the url
com.pcbsys.nirvana.client.nUserAuthentication.nUserAuthentication ( String  username,
String  password,
String  authUrl,
int  authType,
boolean  requestToken 
) throws IOException

Construct the authentication with as user name, password and the URL of the authenticating Nirvana plugin.

Parameters
usernamethe username to be authenticated
passwordthe password to use for authentication
authUrlthe url to use for the authentication
authTypethe type of authentication to use (BASIC/DIGEST)
requestTokenrequest to generate a token for the authentication
Exceptions
IOExceptionthrown should there be any problems authenticating or accessing the url

Member Function Documentation

String com.pcbsys.nirvana.client.nUserAuthentication.getAuthUser ( )

Obtain the username as returned from the server authentication.

Returns
the server returned user name
String com.pcbsys.nirvana.client.nUserAuthentication.getDescription ( )

Obtain the description associated with the authenticated user.

Returns
the user description as denoted by the server's plugin authenticator
String [] com.pcbsys.nirvana.client.nUserAuthentication.getGroupDescription ( )

Obtain the list of authorized group descriptions to which this user belongs, as denoted by the chosen authenticator on the realm plugin.

Returns
a list of group descriptions this user belongs
int [] com.pcbsys.nirvana.client.nUserAuthentication.getGroupId ( )

Obtain the list of authorized group ids to which this user belongs, as denoted by the chosen authenticator on the realm plugin.

Returns
a list of group ids this user belongs
String [] com.pcbsys.nirvana.client.nUserAuthentication.getGroupName ( )

Obtain the list of authorized groups to which this user belongs, as denoted by the chosen authenticator on the realm plugin.

Returns
a list of groups this user belongs
String com.pcbsys.nirvana.client.nUserAuthentication.getHomeId ( )

Obtain the home group of the authenticated user.

Returns
the users' home group
BitSet com.pcbsys.nirvana.client.nUserAuthentication.getPermissions ( )

Obtain the BitSet representing the permissions allocated to this user.

Returns
the BitSet of permissions
String com.pcbsys.nirvana.client.nUserAuthentication.getToken ( )

Obtain the token generated by the server if one was requested.

Returns
the generated token
String com.pcbsys.nirvana.client.nUserAuthentication.getUsername ( )

Obtain the username passed into the authentication.

Returns
the user name
boolean com.pcbsys.nirvana.client.nUserAuthentication.isValid ( )

Determine whether authentication was successful.

Returns
true if successful, else false