Skip to Content

Basic auth in ycommersewebservices rest controller

Hi experts,

In my extension there ist a rest controller which should be secured with basic auth. It gets calles like: and the controller listens at @RequestMapping(value = "/{baseSiteId}/products/{code}/stocks/online") I was following a tutorial and came up with a SecurityConfiguration

 public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
     private static String REALM="STOCKSWAP";
     public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
     protected void configure(HttpSecurity http) throws Exception {
     public CustomBasicAuthenticationEntryPoint getBasicAuthEntryPoint(){
         return new CustomBasicAuthenticationEntryPoint();

On serverstart it gets loaded, was made sure with a breakpoint. But when I call the controller without credentials, I still get a response with data. It seems that maybe something with the antMatcher is wrong, did somebody of you already do this or can you point me into the direction of the problem?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 03, 2017 at 08:18 PM

    I observed the same behavior with my custom ycomm-ws. Had raised a question here, no responses yet.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.