org.apache.tomee.catalina.realm
Class CdiEventRealm

java.lang.Object
  extended by org.apache.catalina.util.LifecycleBase
      extended by org.apache.catalina.util.LifecycleMBeanBase
          extended by org.apache.catalina.realm.RealmBase
              extended by org.apache.tomee.catalina.realm.CdiEventRealm
All Implemented Interfaces:
MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Realm

public class CdiEventRealm
extends org.apache.catalina.realm.RealmBase

This simple CDI based realm gives the ability to send events a webapp can react to in order to authenticate the user. There is one different event per credential types to make it easier to implement.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.catalina.realm.RealmBase
org.apache.catalina.realm.RealmBase.AllRolesMode
 
Field Summary
 
Fields inherited from class org.apache.catalina.realm.RealmBase
allRolesMode, container, containerLog, digest, digestEncoding, info, md, md5Encoder, md5Helper, realmPath, sm, stripRealmForGss, support, validate, x509UsernameRetriever, x509UsernameRetrieverClassName
 
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase
mserver
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
CdiEventRealm()
           
 
Method Summary
 Principal authenticate(GSSContext gssContext, boolean storeCreds)
           
 Principal authenticate(String username, String credentials)
           
 Principal authenticate(String username, String digest, String nonce, String nc, String cnonce, String qop, String realm, String md5a2)
           
 Principal authenticate(X509Certificate[] certs)
           
 void backgroundProcess()
           
 org.apache.catalina.deploy.SecurityConstraint[] findSecurityConstraints(org.apache.catalina.connector.Request request, org.apache.catalina.Context context)
           
protected  String getName()
           
protected  String getPassword(String username)
           
protected  Principal getPrincipal(String username)
           
 
Methods inherited from class org.apache.catalina.realm.RealmBase
addPropertyChangeListener, authenticate, compareCredentials, digest, Digest, getAllRolesMode, getContainer, getDigest, getDigest, getDigestCharset, getDigestEncoding, getDomainInternal, getInfo, getObjectNameKeyProperties, getPrincipal, getPrincipal, getRealmPath, getRealmSuffix, getServer, getValidate, getX509UsernameRetrieverClassName, hasMessageDigest, hasResourcePermission, hasRole, hasUserDataPermission, initInternal, isStripRealmForGss, main, removePropertyChangeListener, setAllRolesMode, setContainer, setDigest, setDigestEncoding, setRealmPath, setStripRealmForGss, setValidate, setX509UsernameRetrieverClassName, startInternal, stopInternal, toString
 
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
 
Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CdiEventRealm

public CdiEventRealm()
Method Detail

authenticate

public Principal authenticate(String username,
                              String credentials)
Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase

authenticate

public Principal authenticate(String username,
                              String digest,
                              String nonce,
                              String nc,
                              String cnonce,
                              String qop,
                              String realm,
                              String md5a2)
Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase

authenticate

public Principal authenticate(GSSContext gssContext,
                              boolean storeCreds)
Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase

authenticate

public Principal authenticate(X509Certificate[] certs)
Specified by:
authenticate in interface org.apache.catalina.Realm
Overrides:
authenticate in class org.apache.catalina.realm.RealmBase

backgroundProcess

public void backgroundProcess()
Specified by:
backgroundProcess in interface org.apache.catalina.Realm
Overrides:
backgroundProcess in class org.apache.catalina.realm.RealmBase

findSecurityConstraints

public org.apache.catalina.deploy.SecurityConstraint[] findSecurityConstraints(org.apache.catalina.connector.Request request,
                                                                               org.apache.catalina.Context context)
Specified by:
findSecurityConstraints in interface org.apache.catalina.Realm
Overrides:
findSecurityConstraints in class org.apache.catalina.realm.RealmBase

getName

protected String getName()
Specified by:
getName in class org.apache.catalina.realm.RealmBase

getPassword

protected String getPassword(String username)
Specified by:
getPassword in class org.apache.catalina.realm.RealmBase

getPrincipal

protected Principal getPrincipal(String username)
Specified by:
getPrincipal in class org.apache.catalina.realm.RealmBase


Copyright © 1999–2015 The Apache Software Foundation. All rights reserved.