Results 1 to 4 of 4

Thread: Customize Exception?

  1. #1
    Join Date
    Jun 2010
    Posts
    2

    Question Customize Exception?

    No useful, please try another one.
    Last edited by ricca; Nov 25th, 2010 at 08:50 PM.

  2. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    I don't really understand what you mean. Why would it be better to throw different exceptions?

    Also, you don't normally need to override or implement an AuthenticationManager when using Spring Security.
    Spring - by Pivotal
    twitter @tekul

  3. #3
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    If you have different login checks in your application then you can throw different exceptions, but I'm still not clear what you need them for. What are you actually trying to achieve - i.e. what's the requirement driving this?
    Spring - by Pivotal
    twitter @tekul

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    If you are customizing the authentication checks then you have full control over what exception is thrown. It should just be a subclass of AuthenticationException. You can control the redirection by implementing an AuthenticationFailureHandler which chooses the location based on the exception type.
    Spring - by Pivotal
    twitter @tekul

Posting Permissions

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