I need to configure both BASIC and FORM authentication methods depending on web resource in my Java EE application. It means that for example for path /app/services I want to authenticate using BASIC and for the rest of the application method would be FORM.
Is it even possible without Spring but in pure Java EE?
It's possible, but you'd need to create and install your own authentication module instead of using the two build-in BASIC and FORM ones.
Java EE has an API/SPI for this called JASPIC. On top of that, many application servers have an alternative native API for this.