Implement Authentication Filter (2.1.3.3)

This commit is contained in:
2021-04-29 17:37:23 +02:00
parent 1e96417a3f
commit 1363e83aa3
7 changed files with 161 additions and 8 deletions
@@ -1,5 +1,8 @@
package dst.ass2.service.api.auth.rest;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
import dst.ass2.service.api.auth.AuthenticationException;
@@ -8,11 +11,12 @@ import dst.ass2.service.api.auth.NoSuchUserException;
/**
* The IAuthenticationResource exposes parts of the {@code IAuthenticationService} as a RESTful interface.
*/
@Path("auth")
public interface IAuthenticationResource {
// TODO annotate the class and methods with the correct javax.ws.rs annotations
Response authenticate(String email, String password)
@POST
@Path("authenticate")
Response authenticate(@FormParam("email") String email, @FormParam("password") String password)
throws NoSuchUserException, AuthenticationException;
}