Class AbstractEdAuthRealm
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- edu.vt.middleware.ldap.ed.jetty.realm.AbstractEdAuthRealm
-
- All Implemented Interfaces:
org.eclipse.jetty.security.LoginService
,org.eclipse.jetty.util.component.LifeCycle
- Direct Known Subclasses:
EdAuthRealm
,LoginRealm
public abstract class AbstractEdAuthRealm extends org.eclipse.jetty.util.component.AbstractLifeCycle implements org.eclipse.jetty.security.LoginService
Base class to provide drop in authentication against EdAuth using Jetty security realms.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected EdAuthService
auth
Directory classprotected org.eclipse.jetty.security.IdentityService
identityService
Default IdentityService for realm.protected org.slf4j.Logger
logger
Class logger instance.protected String
realmName
Descriptive information about this Realm implementation.
-
Constructor Summary
Constructors Constructor Description AbstractEdAuthRealm(EdAuthService service, String name)
Creates a new instance of an EDAuthRealm object that can provide authentication against EdAuth for the production environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jetty.security.IdentityService
getIdentityService()
Return the defaultIdentityService
String
getName()
Returns the name of the realm.org.eclipse.jetty.server.UserIdentity
login(String username, Object credentials, javax.servlet.ServletRequest servletRequest)
The core function which authenticates the user and gathers the roles.void
logout(org.eclipse.jetty.server.UserIdentity user)
This method is not supported by this Realm.void
setIdentityService(org.eclipse.jetty.security.IdentityService iService)
This method is not supported in this realm.void
setName(String name)
Sets the name of the realm.boolean
validate(org.eclipse.jetty.server.UserIdentity user)
This method will return true is the user is not null, false otherwise.
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
Class logger instance.
-
identityService
protected final org.eclipse.jetty.security.IdentityService identityService
Default IdentityService for realm.
-
realmName
protected String realmName
Descriptive information about this Realm implementation.
-
auth
protected EdAuthService auth
Directory class
-
-
Constructor Detail
-
AbstractEdAuthRealm
public AbstractEdAuthRealm(EdAuthService service, String name)
Creates a new instance of an EDAuthRealm object that can provide authentication against EdAuth for the production environment.- Parameters:
service
-EdAuthService
to perform authenticationname
-String
realm name
-
-
Method Detail
-
getName
public String getName()
Returns the name of the realm. (default: EdAuthRealm)- Specified by:
getName
in interfaceorg.eclipse.jetty.security.LoginService
- Returns:
String
-
login
public org.eclipse.jetty.server.UserIdentity login(String username, Object credentials, javax.servlet.ServletRequest servletRequest)
The core function which authenticates the user and gathers the roles.
-
validate
public boolean validate(org.eclipse.jetty.server.UserIdentity user)
This method will return true is the user is not null, false otherwise.- Specified by:
validate
in interfaceorg.eclipse.jetty.security.LoginService
- Parameters:
user
-UserIdentity
- Returns:
boolean
-
logout
public void logout(org.eclipse.jetty.server.UserIdentity user)
This method is not supported by this Realm. It will do nothing.- Specified by:
logout
in interfaceorg.eclipse.jetty.security.LoginService
- Parameters:
user
-UserIdentity
-
getIdentityService
public org.eclipse.jetty.security.IdentityService getIdentityService()
Return the defaultIdentityService
- Specified by:
getIdentityService
in interfaceorg.eclipse.jetty.security.LoginService
- Returns:
IdentityService
-
setIdentityService
public void setIdentityService(org.eclipse.jetty.security.IdentityService iService)
This method is not supported in this realm.- Specified by:
setIdentityService
in interfaceorg.eclipse.jetty.security.LoginService
- Parameters:
iService
-IdentityService
-
-