Cors problem with authenticatedUrlPatterns

Gives cors error to api after adding authenticatedUrlPatterns to

I am using jmix custom controller

Снимок экрана 2022-03-01 в 14.01.26
Снимок экрана 2022-03-01 в 14.03.35

Снимок экрана 2022-03-01 в 14.13.54


Currently, the property only enables token security for the specified endpoints and doesn’t apply any CORS settings for the URLs.

Probably, CORS settings from the should be applied to such URLs, I’ve created an issue for that.

What you can do now is to specify CORS configuration for your URLs explicitly:

    public WebMvcConfigurer corsConfigurer() {

        return new WebMvcConfigurer() {
            public void addCorsMappings(CorsRegistry registry) {

Where to add this in project.

In main application class annotated with @SpringBootApplication.

Sorry, i have missed to mention that i require it in my Cuba application. I have searched through my Cuba application but could not find the main application class. I am accessing rest API through URLs. I have posted a support question in cuba forum at Rest api cors issue - CUBA.Platform but could not get any guidance. Please guide.