org.apache.jetspeed.security.impl.ntlm
Class NtlmSecurityValve

java.lang.Object
  extended by org.apache.jetspeed.pipeline.valve.AbstractValve
      extended by org.apache.jetspeed.security.impl.AbstractSecurityValve
          extended by org.apache.jetspeed.security.impl.ntlm.NtlmSecurityValve
All Implemented Interfaces:
SecurityValve, org.apache.jetspeed.pipeline.valve.Valve

public class NtlmSecurityValve
extends AbstractSecurityValve

NTLMSecurityValve provides Subject creation based on the NTLM provided request.getRemoteUser() user name. When request.getRemoteUser() holds a valid value, then this user is authorized. Otherwise the username is retrieved from the Principal name in the request. In this way you can use NTLM authentication, with a fallback authentication method in case the user is not properly authenticated / authorized using NTLM. There are basically three authentication scenarios:

  1. The user is successfully authenticated and authorized by Ntml authentication

    A Subject is created, with Principal derived from the remoteUser value from Ntlm authentication

  2. The user is not authenticated by Ntlm, or the authenticated (can be NTLM or any other method) user cannot be authorized by Jetspeed.

    An anonymous Subject is created. The user can then be redirected to a login page for example.

  3. The user is authenticated by a (non-NTLM) authentication method, e.g. container-based form authentication.

    A subject is created based on the Principal name in the request.

Version:
$Id$
Author:
David Sean Taylor , Randy Walter , Scott T. Weaver, Dennis Dam

Field Summary
private  String networkDomain
           
private  boolean ntlmAuthRequired
           
private  boolean omitDomain
           
private  org.apache.jetspeed.statistics.PortalStatistics statistics
           
private  org.apache.jetspeed.security.UserManager userMgr
           
 
Fields inherited from class org.apache.jetspeed.security.impl.AbstractSecurityValve
authenticationConfiguration
 
Fields inherited from interface org.apache.jetspeed.pipeline.valve.SecurityValve
IP_ADDRESS
 
Constructor Summary
NtlmSecurityValve(org.apache.jetspeed.security.UserManager userMgr, String networkDomain, boolean omitDomain, boolean ntlmAuthRequired)
           
NtlmSecurityValve(org.apache.jetspeed.security.UserManager userMgr, String networkDomain, boolean omitDomain, boolean ntlmAuthRequired, org.apache.jetspeed.statistics.PortalStatistics statistics)
           
NtlmSecurityValve(org.apache.jetspeed.security.UserManager userMgr, String networkDomain, boolean omitDomain, boolean ntlmAuthRequired, org.apache.jetspeed.statistics.PortalStatistics statistics, org.apache.jetspeed.administration.PortalAuthenticationConfiguration authenticationConfiguration)
           
 
Method Summary
protected  Subject getSubject(org.apache.jetspeed.request.RequestContext context)
           getSubject
protected  Principal getUserPrincipal(org.apache.jetspeed.request.RequestContext context)
           getUserPrincipal
 String toString()
           
 
Methods inherited from class org.apache.jetspeed.security.impl.AbstractSecurityValve
getSubjectFromSession, invoke, isSessionExpired
 
Methods inherited from class org.apache.jetspeed.pipeline.valve.AbstractValve
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.pipeline.valve.Valve
initialize
 

Field Detail

userMgr

private org.apache.jetspeed.security.UserManager userMgr

statistics

private org.apache.jetspeed.statistics.PortalStatistics statistics

networkDomain

private String networkDomain

ntlmAuthRequired

private boolean ntlmAuthRequired

omitDomain

private boolean omitDomain
Constructor Detail

NtlmSecurityValve

public NtlmSecurityValve(org.apache.jetspeed.security.UserManager userMgr,
                         String networkDomain,
                         boolean omitDomain,
                         boolean ntlmAuthRequired,
                         org.apache.jetspeed.statistics.PortalStatistics statistics,
                         org.apache.jetspeed.administration.PortalAuthenticationConfiguration authenticationConfiguration)
Parameters:
userMgr - A UserManager
statistics - Portal Statistics
networkDomain - The network domain is used in combination with the omitDomain flag.
omitDomain - If true, then the network domain is stripped from the remoteUser name.
ntlmAuthRequired - if true, then an exception is thrown when there is no valid remoteUser, or the remoteUser cannot be authorized.

NtlmSecurityValve

public NtlmSecurityValve(org.apache.jetspeed.security.UserManager userMgr,
                         String networkDomain,
                         boolean omitDomain,
                         boolean ntlmAuthRequired,
                         org.apache.jetspeed.statistics.PortalStatistics statistics)

NtlmSecurityValve

public NtlmSecurityValve(org.apache.jetspeed.security.UserManager userMgr,
                         String networkDomain,
                         boolean omitDomain,
                         boolean ntlmAuthRequired)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getUserPrincipal

protected Principal getUserPrincipal(org.apache.jetspeed.request.RequestContext context)
                              throws Exception
Description copied from class: AbstractSecurityValve

getUserPrincipal

Should build and return a java.security.Principal that represents the user name the Subject returned from getSubject()

Specified by:
getUserPrincipal in class AbstractSecurityValve
Returns:
Principal
Throws:
Exception

getSubject

protected Subject getSubject(org.apache.jetspeed.request.RequestContext context)
                      throws Exception
Description copied from class: AbstractSecurityValve

getSubject

Should build and return a javax.security.Subject

Specified by:
getSubject in class AbstractSecurityValve
Returns:
Subject
Throws:
Exception


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.