SpringBoot Oauth2 when ignore url principal is null

Viewed 53

When I ignore "/restaurants"

@Override
public void configure(WebSecurity web) {
    web.ignoring().antMatchers("/restaurants");
}

Principal on microservice is null but I need it becouse I use for example @RequestParam "my" it shows only owner restaurants.

I have POST method "/restaurants" when I add restaurant the same principal is null and I don't wanna have public POST and I fetch userId from principal.

0 Answers
Related