You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by "Peter Hornig (JIRA)" <ji...@apache.org> on 2007/02/01 15:20:05 UTC

[jira] Created: (RAMPART-22) Exception handling in UsernameTokenProcessor.handleUsernameToken

Exception handling in UsernameTokenProcessor.handleUsernameToken
----------------------------------------------------------------

                 Key: RAMPART-22
                 URL: https://issues.apache.org/jira/browse/RAMPART-22
             Project: Rampart
          Issue Type: Bug
            Reporter: Peter Hornig


When UsernameTokenProcessor.handleUsernameToken sees an WSSecurityEception (thrown by a WsPasswordCallback handler)
it just overwrites this Exception 
---------------
            try {
                cb.handle(callbacks);
            } catch (IOException e) {
                throw new WSSecurityException(WSSecurityException.FAILURE,
                        "noPassword",
                        new Object[]{user});

-------------


- So when i throw an Exception which states: "password expired" , or  "wrong password" , it it always converted into a new exception with the wrong reason.

- The origin of the new Exception is not used as the cause of the new exception, so there is no way to drill down to the cause of the Exception


 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (RAMPART-22) Exception handling in UsernameTokenProcessor.handleUsernameToken

Posted by "Peter Hornig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/RAMPART-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471612 ] 

Peter Hornig commented on RAMPART-22:
-------------------------------------

Hi  Ruchith,

Yes this would help a little.

In addition,
I would suggest to just rethrow the Exception, in 
case it is a WSSecurityException.

The "noPassword" message is a bit misleading. 

Regards
Peter







> Exception handling in UsernameTokenProcessor.handleUsernameToken
> ----------------------------------------------------------------
>
>                 Key: RAMPART-22
>                 URL: https://issues.apache.org/jira/browse/RAMPART-22
>             Project: Rampart
>          Issue Type: Bug
>            Reporter: Peter Hornig
>
> When UsernameTokenProcessor.handleUsernameToken sees an WSSecurityEception (thrown by a WsPasswordCallback handler)
> it just overwrites this Exception 
> ---------------
>             try {
>                 cb.handle(callbacks);
>             } catch (IOException e) {
>                 throw new WSSecurityException(WSSecurityException.FAILURE,
>                         "noPassword",
>                         new Object[]{user});
> -------------
> - So when i throw an Exception which states: "password expired" , or  "wrong password" , it it always converted into a new exception with the wrong reason.
> - The origin of the new Exception is not used as the cause of the new exception, so there is no way to drill down to the cause of the Exception
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (RAMPART-22) Exception handling in UsernameTokenProcessor.handleUsernameToken

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/RAMPART-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471563 ] 

Ruchith Udayanga Fernando commented on RAMPART-22:
--------------------------------------------------

How about changing the new WSSecurityException thrown to include the cause as well:

            try {
                cb.handle(callbacks);
            } catch (IOException e) {
                throw new WSSecurityException(WSSecurityException.FAILURE,
                        "noPassword",
                        new Object[]{user}, e);
            } catch (UnsupportedCallbackException e) {
                throw new WSSecurityException(WSSecurityException.FAILURE,
                        "noPassword",
                        new Object[]{user}, e);
            }

Thanks,
Ruchith

> Exception handling in UsernameTokenProcessor.handleUsernameToken
> ----------------------------------------------------------------
>
>                 Key: RAMPART-22
>                 URL: https://issues.apache.org/jira/browse/RAMPART-22
>             Project: Rampart
>          Issue Type: Bug
>            Reporter: Peter Hornig
>
> When UsernameTokenProcessor.handleUsernameToken sees an WSSecurityEception (thrown by a WsPasswordCallback handler)
> it just overwrites this Exception 
> ---------------
>             try {
>                 cb.handle(callbacks);
>             } catch (IOException e) {
>                 throw new WSSecurityException(WSSecurityException.FAILURE,
>                         "noPassword",
>                         new Object[]{user});
> -------------
> - So when i throw an Exception which states: "password expired" , or  "wrong password" , it it always converted into a new exception with the wrong reason.
> - The origin of the new Exception is not used as the cause of the new exception, so there is no way to drill down to the cause of the Exception
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.