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

Christian Schneider commented on CXF-6206:
------------------------------------------

If we always have either basic auth or WS Security based auth then adding an 
interceptor might work. I think though there might be cases where you want to 
enable both. So the user can log in using basic auth or a ws security 
UsernameToken. In that case we need a different approach. I wonder if we could 
have a HTTPAuthenticationFailed exception extending AuthenticationException. We 
could then only convert the specialised exception to 401. The 
HTTPAuthenticationException could then also store the AuthenticationType and 
the realm. WDYT?

> JAASLoginInterceptor: Return proper unauthorized response when JAAS login 
> with basic auth fails
> -----------------------------------------------------------------------------------------------
>
>                 Key: CXF-6206
>                 URL: https://issues.apache.org/jira/browse/CXF-6206
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core, Transports
>            Reporter: Christian Schneider
>            Assignee: Christian Schneider
>             Fix For: 3.1.0
>
>
> Currently we return a Fault with a AuthenticationException when JAAS login 
> fails.
> The proper response would be a 401 status with a suitable WWW-Authenticate 
> header.
> I experimented with turning the AuthenticationException into a 401 response 
> in the http transport. Not sure where to take auth type and realm from 
> though. I am also not sure how to distinguish basic auth from WSS Security 
> UsernameToken. As in the second case 401 is probably not correct.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to