org.apache.commons.httpclient.auth

Class AuthState

public class AuthState extends Object

This class provides detailed information about the state of the authentication process.

Since: 3.0

Author: Oleg Kalnichevski

Field Summary
static StringPREEMPTIVE_AUTH_SCHEME
Constructor Summary
AuthState()
Default constructor.
Method Summary
AuthSchemegetAuthScheme()
StringgetRealm()
Returns the authentication realm.
voidinvalidate()
Invalidates the authentication state by resetting its parameters.
booleanisAuthAttempted()
Tests whether authenication challenge has been responsed to
booleanisAuthRequested()
Tests whether authenication challenge has been received
booleanisPreemptive()
Tests if preemptive authentication is used.
voidsetAuthAttempted(boolean challengeResponded)
Sets authentication attempt status
voidsetAuthRequested(boolean challengeReceived)
Sets authentication request status
voidsetAuthScheme(AuthScheme authScheme)
Assigns the given authentication scheme.
voidsetPreemptive()
Preemptively assigns Basic authentication scheme.
StringtoString()

Field Detail

PREEMPTIVE_AUTH_SCHEME

public static final String PREEMPTIVE_AUTH_SCHEME

Constructor Detail

AuthState

public AuthState()
Default constructor.

Method Detail

getAuthScheme

public AuthScheme getAuthScheme()
Returns the authentication scheme.

Returns: authentication scheme

getRealm

public String getRealm()
Returns the authentication realm.

Returns: the name of the authentication realm

invalidate

public void invalidate()
Invalidates the authentication state by resetting its parameters.

isAuthAttempted

public boolean isAuthAttempted()
Tests whether authenication challenge has been responsed to

Returns: true if authenication challenge has been responsed to, false otherwise

isAuthRequested

public boolean isAuthRequested()
Tests whether authenication challenge has been received

Returns: true if authenication challenge has been received, false otherwise

isPreemptive

public boolean isPreemptive()
Tests if preemptive authentication is used.

Returns: true if using the default Basic authentication scheme, false otherwise.

setAuthAttempted

public void setAuthAttempted(boolean challengeResponded)
Sets authentication attempt status

Parameters: challengeResponded true if authenication has been attempted, false otherwise

setAuthRequested

public void setAuthRequested(boolean challengeReceived)
Sets authentication request status

Parameters: challengeReceived true if authenication has been requested, false otherwise

setAuthScheme

public void setAuthScheme(AuthScheme authScheme)
Assigns the given authentication scheme.

Parameters: authScheme the authentication scheme

setPreemptive

public void setPreemptive()
Preemptively assigns Basic authentication scheme.

toString

public String toString()
Copyright (c) 1999-2005 - Apache Software Foundation