Spring security with Oauth2 or Http-Basic authentication for the same resource

前端 未结 8 1154
南方客
南方客 2021-01-30 09:07

I\'m attempting to implement an API with resources that are protected by either Oauth2 OR Http-Basic authentication.

When I load the WebSecurityConfigurerAdapter which a

8条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 09:45

    I believe that is not possible to have both authentications. You can have basic authentication and oauth2 authentication, but for distinct endpoints. The way as you did, the first configuration will overcome the second, in this case, http basic will be used.

提交回复
热议问题