Swagger UI & Api docs not opening, with Springdoc WebMvc throws UNAUTHORIZED ACCESS Permission error

64 Views Asked by At

I've tried opening swagger UI and api docs with the latest dependency of springdoc :

 <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
      <version>2.3.0</version>
   </dependency>

The swagger UI and the api docs link at:

localhost:8085/appName/v3/api/docs
localhost:8085/appName/swagger-ui/index.html

while opening throws the error on browser :


{
"errorType": "UNAUTHORIZED",
"category": "ACCESS_PERMISSION",
"severity": "BLOCKER",
"errorObject": {
"errorType": "UNAUTHORIZED",
"category": "ACCESS_PERMISSION",
"severity": "BLOCKER",
"time": "Dec 27, 2023, 3:47:00 PM",
"message": "Authentiaction Failure, Login and try again !"
},
"time": "Dec 27, 2023, 3:47:00 PM",
"errCodeMap": {},
"detailMessage": "Authentiaction Failure, Login and try again !",
"stackTrace": \[\],
"suppressedExceptions": \[\]
}

The same when tried with springdoc-openapi-ui dependency and @EnablWebMvc was working fine with configured security.
have also included the swagger antmatchers in the websecurity still it shows the auhtorization issue.

Can anyone help or have faced this issue?

0

There are 0 best solutions below