Announcement Announcement Module
No announcement yet.
Oauth2 Exception Handler Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Oauth2 Exception Handler


    I am using CAS and Oauth2 both in my webapp and I need to customize error handling accordingly. CAS is used for webpages where as Oauth2 (2 legged auth) is used for rest calls.

    AccessDenied for CAS related webpage should result in taking user back to login page where as for Oauth2 rest calls it should result in appropriate HTTP status.

    What I am seeing is AccessDecisionManager would throw AccessDenied exception for incorrect role and Oauth2ExceptionHandlerFilter will just ignore is since it is not instanceof OAuth2Exception.

    What is good way to handle this scenario? Please help!


  • #2

    So have you tried hooking up OAuth2 yet? I'm not sure that there will be a problem since OAuth2ExceptionHandlerFilter is only designed to handle the OAuth2 flow, leaving any other exceptions to be handled by the other mechanism (in your case, CAS). Can you describe the specific problem that you're seeing?

    P.S. OAuth2 isn't 2-legged oauth. 2 legged oauth only applies to OAuth 1.