org.apache.jetspeed.security.impl.ntlm
Class NtlmSecurityValve
java.lang.Object
org.apache.jetspeed.pipeline.valve.AbstractValve
org.apache.jetspeed.security.impl.AbstractSecurityValve
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:
-
The user is successfully authenticated and authorized by Ntml authentication
A Subject is created, with Principal derived from the remoteUser value from Ntlm authentication
-
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.
-
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
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)
|
Methods inherited from interface org.apache.jetspeed.pipeline.valve.Valve |
initialize |
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
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 UserManagerstatistics
- Portal StatisticsnetworkDomain
- 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)
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.