@RestService anonymous

I’m trying to expose a service over Rest API without authentication, but I shows me as “Forbidden”. How to fix it?

Jmiox 2.3.1
edurbs/xvspellconverter at feature/directConvert (github.com)

application.properties

jmix.rest.anonymous-url-patterns = /rest/services/convert/execute

ConvertController.java

@RestService("convert")
public class ConvertController {

    @Autowired
    private ConvertUseCase convertUseCase;

    @RestMethod
    public String execute(String text) {
        return convertUseCase.execute(text);
    }
}

Post

http://localhost:8080/rest/services/convert/execute
{
    "text" : "teste"
}

Result

{
    "timestamp": "2024-07-19T16:39:12.399+00:00",
    "status": 403,
    "error": "Forbidden",
    "path": "/rest/services/convert/execute"
}

Hi,

The jmix.rest.anonymous-url-patterns property is processed by the Authorization Server add-on. Try to add the add-on to your project.

Alternatively, you may configure endpoints security by custom security configuration. See example in the documentation.