Announcement Announcement Module
Collapse
No announcement yet.
How to add extra exception Mappings to ProviderManager Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to add extra exception Mappings to ProviderManager

    Hi,

    How can one add extra exception mappings, so they can be processed to publish custom events on custom exceptions from additionalAuthenticationChecks() from overridden DaoAuthenticationProvider.

    Regards and thanks

  • #2
    This is what you're after?
    http://www.acegisecurity.org/multipr...il.Properties)

    Comment


    • #3
      Thanks for the reply, but i am not sure how to extend this to add exceptionMappings to ProviderManager, the doAddExtraDefaultExceptionMappings(Properties) method gives handle to the class level static DEFAULT_EXCEPTION_MAPPINGS but not the instance level exceptionMappings which are being used in "public Authentication doAuthentication(Authentication authentication)".

      Comment


      • #4
        Ahhh just looking at the code, I see your point. I also think you might have found a bug! The DEFAULT_EXCEPTION_MAPPINGS are added to the exceptionMappings in the constructor. This is then used in the doAuthentication method. I'm pretty sure the exceptionMappings properties are supposed to be passed into doAddExtraDefaultExceptionMappings(..). You could patch this yourself. I would also have a look in JIRA and see if this has already been raised.
        http://opensource.atlassian.com/proj...Dashboard.jspa

        Current....
        Code:
        public ProviderManager() {
            exceptionMappings.putAll(DEFAULT_EXCEPTION_MAPPINGS);
        }
        
        public void afterPropertiesSet() throws Exception {
            checkIfValidList(this.providers);
            Assert.notNull(this.messages, "A message source must be set");
            doAddExtraDefaultExceptionMappings(DEFAULT_EXCEPTION_MAPPINGS);
        }
        Should be....
        Code:
        public void afterPropertiesSet() throws Exception {
            checkIfValidList(this.providers);
            Assert.notNull(this.messages, "A message source must be set");
            doAddExtraDefaultExceptionMappings(exceptionMappings);
        }

        Comment


        • #5
          Thanks once again, ive added this to JIRA.

          Comment


          • #6
            Any chance you could post the JIRA link back here for reference?

            Comment


            • #7
              Originally posted by karldmoore View Post
              Any chance you could post the JIRA link back here for reference?
              here it is ...

              http://opensource.atlassian.com/proj...browse/SEC-438

              Comment

              Working...
              X