grails - Integrating OpenAM, tomcat J2EE policy agent with Spring Security-enabled web application -


we trying fine-grained authorizations using spring security while having user authentication , coarse-grained authorization using openam policies feature application realm. mean coarse-grained simple uri rules subjects. mean fine-grained authorization @ web application level such using acls using spring-security-acls.

to accomplish this, approach have thought use ** spring security preauthenticationfilters** outlined in spring-security reference manual. got thought after reading question pre-authentication

to rapid prototyping, have chosen grails 2.2.3 web application platform plugins spring-security-core , acls behind openam , openam j2ee policy agent interfaces. openam policy setup authenticate user , return uid (ldap user id) in policy response header. mapped user_id in response provider , sent http header policy agent.

the grails application resources.groovy looks this:

beans = {    preauthenticatedgrantedauthoritiesuserdetailsservice(preauthenticatedgrantedauthoritiesuserdetailsservice)    preauthenticatedauthenticationprovider(preauthenticatedauthenticationprovider) {     preauthenticateduserdetailsservice =   ref('preauthenticatedgrantedauthoritiesuserdetailsservice')  }  requestheaderauthenticationfilter(requestheaderauthenticationfilter) {     authenticationmanager = ref('authenticationmanager')     principalrequestheader = 'user_id'  } } 

the bootstrap.groovy looks this:

def init = {     servletcontext ->       springsecurityutils.clientregisterfilter('requestheaderauthenticationfilter',securityfilterposition.pre_auth_filter); } 

when tested in local setup, errors ...

org.springframework.security.web.authentication.preauth.preauthenticatedcredentialsnotfoundexception: user_id header not found in request.     @ org.springframework.security.web.authentication.preauth.requestheaderauthenticationfilter.getpreauthenticatedprincipal(requestheaderauthenticationfilter.java:43)     @ org.springframework.security.web.authentication.preauth.abstractpreauthenticatedprocessingfilter.doauthenticate(abstractpreauthenticatedprocessingfilter.java:98)     @ org.springframework.security.web.authentication.preauth.abstractpreauthenticatedprocessingfilter.dofilter(abstractpreauthenticatedprocessingfilter.java:86)     @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:381)     @ org.codehaus.groovy.grails.plugins.springsecurity.mutablelogoutfilter.dofilter(mutablelogoutfilter.java:79)     @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:381) 

any clues on how solve issue, or comments/suggestions on approach itself?

thanks responses.

agent filter must first 1 in filter chain ... assured?

if yes, have set debug level 'message' in agent profile , inspect debug log, agent config incorrect.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -