#Apache CXF - Define Basic Authentication requirements?

1 messages · Page 1 of 1 (latest)

ember dagger
#

Hello everybody,

I have created a BasicAuthInterceptor based on this code: https://gist.github.com/palesz/3438143
It works well, but I have some problems. This interceptor cause two requests.
The response of the first request will be 401. After first response has arrived, the client automatically call the endpoint again with Authorization header. In my case SoapUI is the client.

How can I predefine the requirements to know the client, how should call my endpoint?

This is my code now:

//...
Map<String, Object> properties = jaxWsServerFactoryBean.getProperties();
//...
jaxWsServerFactoryBean.setProperties(properties);
        
final Server server = jaxWsServerFactoryBean.create();
Endpoint endpoint = server.getEndpoint();
endpoint.getInInterceptors().add(new BasicAuthInterceptor());```
Gist

Basic HTTP Authentication Interceptor for Apache CXF - BasicAuthAuthorizationInterceptor.java

noble yarrowBOT
#

This post has been reserved for your question.

Hey @ember dagger! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

noble yarrowBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

noble yarrowBOT
#
106ms
ember dagger
#

I have read about policy and it describe what I want, but I don't find any example about it. How can I build a Policy with basic authentication requirements?

noble yarrowBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

noble yarrowBOT
#
102ms
noble yarrowBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

elfin gale
#

what do you want to specify?