'How to make authentication but now authorization with javax.security API?

Is it logically possible to make some Spring endpoint authenticated, but not authorized?

With annotations like

javax.annotation.security.PermitAll;
javax.annotation.security.RolesAllowed;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source