Results 1 to 7 of 7

Thread: How to add extra exception Mappings to ProviderManager

  1. #1
    Join Date
    Feb 2007
    Posts
    4

    Post 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. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

  3. #3
    Join Date
    Feb 2007
    Posts
    4

    Default

    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)".

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    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);
    }

  5. #5
    Join Date
    Feb 2007
    Posts
    4

    Default

    Thanks once again, ive added this to JIRA.

  6. #6
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

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

  7. #7
    Join Date
    Feb 2007
    Posts
    4

    Default

    Quote 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •