[Acegisecurity-developer] hibernate compatability ( blah blah blah )

2004-08-09 Thread administrator
Hi there,
I am new to acegi and have been working with it just over the weekend
so some of this stuff may be absolute bs but please bear with me on this.
I am currently evaluating the use of acegi for my open source project
jestate ( http://jestate.sourceforge.net )
Jestate is (currently) built with the following architecture.
struts -- spring (service) --- spring (dao) -- hibernate
A lot of my methods in the service layer must take an ( Integer) userid.
( It would also be usefull if I could pass an object arround my jsp pages
which indicated the users id as this would be usefull for the
flyweight design pattern. )
The reason for this is that often a user will only be able to see a subset
of the data in the DB.
So it would be really cool if the User ( which implements UserDetails )
also had an id ( Integer ) properties.
That way I could implement my own AuthenticationDao which would
work directly with hibernate and return such a class.
If everything worked with a User interface rather than a concrete 
implimentation
it would also be possible for me to implement it myself ( this would 
allow me
to use xdoclet on it to generate hibernate mapping files).

Also is there any way that I could get this information into the service
beans without adding any ageci dependant code into my struts actions ?
I notice in the contacts example application that it is done by
snip=
SecureContext secureContext = ((SecureContext) ContextHolder.getContext());
final Authentication currentUser = secureContext.getAuthentication();
Contact[] myContacts = 
contactManager.getAllByOwner(currentUser.getPrincipal().toString());

=snip
in the SecureIndexController class.
Is there any way that I could instead move this stuff into my service 
layer so that all
authentication is taken out of my controler classes , this would make a 
cleaner
separation between business logic and security concerns in my 
application code.

Oh yeah one other thing, I am using acegi from source. I built it over 
the weekend myself.

Oh and one other thing if I can be of help integrating hibernate I would 
be more than
happy to contribute any source code to your project.

--b
---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
Acegisecurity-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer


Re: [Acegisecurity-developer] CAS always redirecting back to CAS after authentication

2004-08-09 Thread Scott Battaglia
I was able to figure out my problem.  I was missing an 
AutoIntegrationFilter bean.  It now works.

Thanks!
Scott Battaglia
Application Developer, New Technology Group
Enterprise Systems and Services
Rutgers University Computing Services
Rutgers, the State University of New Jersey
email: [EMAIL PROTECTED]
voice: 732.445.0097
 fax: 732.445.5493

Scott Battaglia wrote:
Hi,
I've just started working with Acegi and CAS and I'm finding it very 
easy and powerful.  However, I've come upon something that's confusing 
me.  I set up my application so that any URL ending with .app forces 
requires authentication.  It properly redirects to CAS for 
authentication but when it goes to the j_acegi_cas_security_check page 
it gets redirected back to CAS.  Does anyone know why this occurs?  
I'm assuming I have some stupid config error that I missed therefore 
I'm attaching my securityContext.xml.

Thanks in advance for your help!
-Scott

?xml version=1.0 encoding=UTF-8?
!DOCTYPE beans PUBLIC  -//SPRING//DTD BEAN//EN 
http://www.springframework.org/dtd/spring-beans.dtd;
beans
!-- === --
!-- SINGLE SIGN ON USING ACEGI AND CAS  --
!-- === --
bean id=serviceProperties 
class=net.sf.acegisecurity.ui.cas.ServiceProperties
property 
name=servicevaluehttps://acsdev12.rutgers.edu/hrinfo/j_acegi_cas_security_check/value/property
property name=sendRenewvaluefalse/value/property
/bean

bean id=casProcessingFilter 
class=net.sf.acegisecurity.ui.cas.CasProcessingFilter
property name=authenticationManagerref bean=authenticationManager 
//property
property 
name=authenticationFailureUrlvalue/casfailed.jsp/value/property
property name=defaultTargetUrlvalue//value/property
property 
name=filterProcessesUrlvalue/j_acegi_cas_security_check/value/property
/bean

bean id=casProcessingFilterEntryPoint 
class=net.sf.acegisecurity.ui.cas.CasProcessingFilterEntryPoint
property 
name=loginUrlvaluehttps://www.acst2.rutgers.edu:8889/cas/login/value/property
property name=servicePropertiesref bean=serviceProperties 
//property
/bean

bean id=authenticationManager 
class=net.sf.acegisecurity.providers.ProviderManager
property name=providers
list
ref bean=casAuthenticationProvider /
/list
/property
/bean

bean id=casAuthenticationProvider 
class=net.sf.acegisecurity.providers.cas.CasAuthenticationProvider
property name=casAuthoritiesPopulatorref bean=casAuthoritiesPopulator 
//property
property name=casProxyDeciderref bean=casProxyDecider 
//property
property name=ticketValidatorref bean=casProxyTicketValidator 
//property
property name=statelessTicketCacheref bean=statelessTicketCache 
//property
property 
name=keyvaluemy_password_for_this_auth_provider_only/value/property
/bean

bean id=casProxyTicketValidator 
class=net.sf.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
property 
name=casValidatevaluehttps://www.acst2.rutgers.edu:8889/cas/serviceValidate/value/property
property name=servicePropertiesref bean=serviceProperties 
//property
/bean

bean id=statelessTicketCache 
class=net.sf.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
property name=minutesToIdlevalue20/value/property
/bean

bean id=casAuthoritiesPopulator 
class=net.sf.acegisecurity.providers.cas.populator.DaoCasAuthoritiesPopulator
property name=authenticationDaoref bean=authenticationDao 
//property
/bean

bean id=casProxyDecider 
class=net.sf.acegisecurity.providers.cas.proxy.RejectProxyTickets /

!-- bean id=authenticationDao 
class=edu.rutgers.acs.hrinfo.dao.support.InMemoryAuthenticationDao /--
bean id=authenticationDao 
class=net.sf.acegisecurity.providers.dao.memory.InMemoryDaoImpl
property name=userMap
value
battags=PASSWORD_NOT_USED,ROLE_SUPER_USER
beeky=PASSWORD_NOT_USED,ROLE_SUPER_USER
/value
/property
/bean
bean id=securityEnforcementFilter 
class=net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter
property name=filterSecurityInterceptorref 
bean=filterInvocationInterceptor//property
property name=authenticationEntryPointref 

Re: [Acegisecurity-developer] Bug in net.sf.acegisecurity.providers.dao.cache.EhCacheBasedUserCache

2004-08-09 Thread Ben Alex
Karel Miarka wrote:
Hi Ben,
with the new release some of my integration test stopped to work with 
NullPointerException in EhCacheBasedUserCache - the cache variable was 
null. (Suprisingly it was working when deployed under Tomcat.)
I have studied the code and than tried to add this line into 
afterPropertiesSet() bellow your comment // dont remove the cache :
cache = CacheManager.getInstance().getCache(CACHE_NAME);
and it seems to be OK.
TIA,
Karel
Hi Karel
EH-CACHE strikes again. The last problem was with web context refreshes. 
Have you tried that with your change?

I've just committed your change to the various implementations we use 
that front EH-CACHE.

Best regards
Ben

---
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink  Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
___
Acegisecurity-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer