You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2013/08/22 21:33:51 UTC

[jira] [Commented] (CXF-5227) OAuthRequestFilter should respond with a 401 exception when no token is supplied.

    [ https://issues.apache.org/jira/browse/CXF-5227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13747800#comment-13747800 ] 

Sergey Beryozkin commented on CXF-5227:
---------------------------------------

javax.ws.rs.NotAuthorizedException is actually equivalent to WebApplicationException(401), it is a 401 specialization. I think this issue is invalid, do you agree ?
                
> OAuthRequestFilter should respond with a 401 exception when no token is supplied.
> ---------------------------------------------------------------------------------
>
>                 Key: CXF-5227
>                 URL: https://issues.apache.org/jira/browse/CXF-5227
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS Security
>    Affects Versions: 2.7.6
>            Reporter: Diarmuid Power
>            Priority: Minor
>
> The OAuthRequestFilter, encounters an unhandled exception when no oAuth token is provided. The following line of code throws a _javax.ws.rs.NotAuthorizedException_
> {code}
> AccessTokenValidation accessTokenV = getAccessTokenValidation();
> {code}
> org.apache.cxf.rs.security.oauth2.filters.OAuthRequestFilter.filter()
> I think that the filter should instead catch this exception and then rethrow an exception that will yield an appropriate error code such as
> {code}
> throw new WebApplicationException( 401 );
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira