I know that best practice is to let everything about authentication/authorization to the service layer.
Controller should not be aware of that.
But how to let a service (from service layer so) to check for http session if I do not pass in the http request?
In this particular case, when login needs some http request context, should the controller be master of the authentication and then pass the retrieved user as parameter of the service like this (in Java)? :
public interface SomeService {
void aService(User user, ...);
}
Other example would be the use the JWT mechanism.
Should the validation of the token be triggered by the controller or by the service, assuming in this later case that we pass the token in parameter of the service?