import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
*/
@POST
@Path(PROCESS_PASSWORD_RESET_PATH)
- synchronized public Response processPasswordReset(@Context UriInfo ui) throws UnsupportedEncodingException, DocumentNotFoundException {
+ @Consumes("application/x-www-form-urlencoded")
+ synchronized public Response processPasswordReset(@Context UriInfo ui,
+ @FormParam("token") String tokenId,
+ @FormParam("password") String base64EncodedPassword) throws UnsupportedEncodingException, DocumentNotFoundException {
Response response = null;
//
//
// Get the 'token' and 'password' params
//
- String tokenId = queryParams.getFirst(AccountClient.PASSWORD_RESET_TOKEN_QP);
if (tokenId == null || tokenId.trim().isEmpty()) {
response = Response.status(Response.Status.BAD_REQUEST).entity(
"The query parameter 'token' is missing or contains no value.").type("text/plain").build();
return response;
}
- String base64EncodedPassword = queryParams.getFirst(AccountClient.PASSWORD_RESET_PASSWORD_QP);
if (base64EncodedPassword == null || base64EncodedPassword.trim().isEmpty()) {
response = Response.status(Response.Status.BAD_REQUEST).entity(
"The query parameter 'password' is missing or contains no value.").type("text/plain").build();