com.caucho.security
Class BasicLogin

java.lang.Object
  extended by com.caucho.security.AbstractLogin
      extended by com.caucho.security.BasicLogin
All Implemented Interfaces:
Login
Direct Known Subclasses:
BasicLogin

public class BasicLogin
extends AbstractLogin

Implements the "basic" auth-method. Basic uses the HTTP authentication with WWW-Authenticate and SC_UNAUTHORIZE.


Field Summary
protected  java.lang.String _realm
           
 
Fields inherited from class com.caucho.security.AbstractLogin
_auth, _singleSignon, log
 
Fields inherited from interface com.caucho.security.Login
LOGIN_PASSWORD, LOGIN_USER_NAME, LOGIN_USER_PRINCIPAL
 
Constructor Summary
BasicLogin()
           
 
Method Summary
 java.lang.String getAuthType()
          Returns the authentication type.
 java.lang.String getRealmName()
          Gets the realm.
protected  java.security.Principal getUserPrincipalImpl(HttpServletRequest request)
          Returns the principal from a basic authentication
 boolean isLoginUsedForRequest(HttpServletRequest request)
          Returns true if the request has a matching login.
 boolean isPasswordBased()
          Returns true if username and password based authentication is supported.
protected  boolean isSavedUserValid(HttpServletRequest request, java.security.Principal savedUser)
          Returns the principal from a basic authentication
protected  void loginChallenge(HttpServletRequest request, HttpServletResponse response)
          Sends a challenge for basic authentication.
 void setRealmName(java.lang.String realm)
          Sets the login realm.
 
Methods inherited from class com.caucho.security.AbstractLogin
findSavedUser, getAuthenticator, getLoginPrincipalImpl, getSingleSignon, getUserPrincipal, init, isLogoutOnSessionTimeout, isSessionSaveLogin, isUserInRole, login, login, loginSuccessResponse, logout, logoutImpl, saveUser, sessionInvalidate, setAuthenticator, setLogoutOnSessionTimeout, setSessionSaveLogin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_realm

protected java.lang.String _realm
Constructor Detail

BasicLogin

public BasicLogin()
Method Detail

setRealmName

public void setRealmName(java.lang.String realm)
Sets the login realm.


getRealmName

public java.lang.String getRealmName()
Gets the realm.


getAuthType

public java.lang.String getAuthType()
Returns the authentication type.

Specified by:
getAuthType in interface Login
Overrides:
getAuthType in class AbstractLogin

isPasswordBased

public boolean isPasswordBased()
Description copied from interface: Login
Returns true if username and password based authentication is supported.

Specified by:
isPasswordBased in interface Login
Overrides:
isPasswordBased in class AbstractLogin
Returns:
See Also:
BasicLogin

isLoginUsedForRequest

public boolean isLoginUsedForRequest(HttpServletRequest request)
Returns true if the request has a matching login.

Specified by:
isLoginUsedForRequest in interface Login
Overrides:
isLoginUsedForRequest in class AbstractLogin

getUserPrincipalImpl

protected java.security.Principal getUserPrincipalImpl(HttpServletRequest request)
Returns the principal from a basic authentication

Overrides:
getUserPrincipalImpl in class AbstractLogin
Parameters:
request -

isSavedUserValid

protected boolean isSavedUserValid(HttpServletRequest request,
                                   java.security.Principal savedUser)
Returns the principal from a basic authentication

Overrides:
isSavedUserValid in class AbstractLogin
Parameters:
request -
savedUser -

loginChallenge

protected void loginChallenge(HttpServletRequest request,
                              HttpServletResponse response)
                       throws java.io.IOException
Sends a challenge for basic authentication.

Overrides:
loginChallenge in class AbstractLogin
Throws:
java.io.IOException