[spring-mvc] How to configure Spring Security to allow Swagger URL to be accessed without authentication

I am using Spring Boot 5. I have this controller that I want an unauthenticated user to invoke.

  //Builds a form to send to devices   
@RequestMapping(value = "/{id}/ViewFormit", method = RequestMethod.GET)
@ResponseBody
String doFormIT(@PathVariable String id) {
    try
    {
        //Get a list of forms applicable to the current user
        FormService parent = new FormService();

Here is what i did in the configuuration.

  @Override
   protected void configure(HttpSecurity http) throws Exception {
    http
            .authorizeRequests()
            .antMatchers(
                    "/registration**",
                    "/{^[\\\\d]$}/ViewFormit",

Hope this helps....

Examples related to spring-mvc

Two Page Login with Spring Security 3.2.x ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean Spring 5.0.3 RequestRejectedException: The request was rejected because the URL was not normalized The type WebMvcConfigurerAdapter is deprecated RestClientException: Could not extract response. no suitable HttpMessageConverter found Spring boot: Unable to start embedded Tomcat servlet container UnsatisfiedDependencyException: Error creating bean with name 8080 port already taken issue when trying to redeploy project from Spring Tool Suite IDE Error creating bean with name 'entityManagerFactory' defined in class path resource : Invocation of init method failed Difference between the annotations @GetMapping and @RequestMapping(method = RequestMethod.GET)

Examples related to swagger

ASP.NET Core - Swashbuckle not creating swagger.json file How to send custom headers with requests in Swagger UI? How to import Swagger APIs into Postman? How to configure Spring Security to allow Swagger URL to be accessed without authentication How can I represent 'Authorization: Bearer <token>' in a Swagger Spec (swagger.json) How to open local files in Swagger-UI Converting Swagger specification JSON to HTML documentation

Examples related to swagger-ui

How to send custom headers with requests in Swagger UI? How to configure Spring Security to allow Swagger URL to be accessed without authentication List of swagger UI alternatives How to open local files in Swagger-UI Generate PDF from Swagger API documentation

Examples related to swagger-2.0

How to configure Spring Security to allow Swagger URL to be accessed without authentication How can I represent 'Authorization: Bearer <token>' in a Swagger Spec (swagger.json) How to open local files in Swagger-UI

Examples related to springfox

How to configure Spring Security to allow Swagger URL to be accessed without authentication