@Test public void testUserSignUp() throws Exception { signUpUser(this); }
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response userSignUp(@Context ContainerRequestContext context, Credentials credentials) { try{ Credentials toSave = authServerLogic.userSignUp(credentials); context.setSecurityContext(new UserContext(context.getUriInfo(),toSave)); logger.info("SignUp Successful. Returning: " + toSave); return ok(toSave); } catch (ServerDAO.DAOException e) { logger.severe(ExceptionUtils.getStackTrace(e)); return fromDAOExpection(e); } catch (Exception e) { logger.severe(ExceptionUtils.getStackTrace(e)); return Response.serverError().build(); } }
AuthenticationEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response userSignUp(@Context ContainerRequestContext context, Credentials credentials) { try{ Credentials toSave = authServerLogic.userSignUp(credentials); context.setSecurityContext(new UserContext(context.getUriInfo(),toSave)); logger.info("SignUp Successful. Returning: " + toSave); return ok(toSave); } catch (ServerDAO.DAOException e) { logger.severe(ExceptionUtils.getStackTrace(e)); return fromDAOExpection(e); } catch (Exception e) { logger.severe(ExceptionUtils.getStackTrace(e)); return Response.serverError().build(); } } }
AuthenticationEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response userSignUp(@Context ContainerRequestContext context, Credentials credentials) { try{ Credentials toSave = authServerLogic.userSignUp(credentials); context.setSecurityContext(new UserContext(context.getUriInfo(),toSave)); logger.info("SignUp Successful. Returning: " + toSave); return ok(toSave); } catch (ServerDAO.DAOException e) { logger.severe(ExceptionUtils.getStackTrace(e)); return fromDAOExpection(e); } catch (Exception e) { logger.severe(ExceptionUtils.getStackTrace(e)); return Response.serverError().build(); } }  }
AuthenticationEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response userSignUp(@Context ContainerRequestContext context, Credentials credentials) { try{ Credentials toSave = authServerLogic.userSignUp(credentials); context.setSecurityContext(new UserContext(context.getUriInfo(),toSave)); logger.info("SignUp Successful. Returning: " + toSave); return ok(toSave); } catch (ServerDAO.DAOException e) { logger.severe(ExceptionUtils.getStackTrace(e)); return fromDAOExpection(e); } catch (Exception e) { logger.severe(ExceptionUtils.getStackTrace(e)); return Response.serverError().build(); } }  @PostConstruct void init(); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response userSignUp(@Context ContainerRequestContext context, Credentials credentials); @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response userSignIn(@Context ContainerRequestContext context, Credentials credentials); @GET @Path("/key") @Produces(MediaType.APPLICATION_JSON) Response getPublicKey(); @GET @Path("/validate/{token}") @Produces(MediaType.APPLICATION_JSON) Response validateAccount(@PathParam("token") String token); @GET @Path("/from/{token}") @Produces(MediaType.APPLICATION_JSON) Response getUserFromToken(@Context ContainerRequestContext context, @PathParam("token") String token); @GET @Path("/recover/{token}") @Produces(MediaType.APPLICATION_JSON) Response recoverFromOneTimeToken(@Context ContainerRequestContext context, @PathParam("token") String token); @POST @Path("/user/data/{userId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response recieveUserData(@Context Session session, @PathParam("userId") String userId, Map<String,?> data); @PUT @Path("/user/data/{userId}") @Produces(MediaType.APPLICATION_JSON) Response sendUserData(@Context Session session, @PathParam("userId") String userId); }
AuthenticationEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response userSignUp(@Context ContainerRequestContext context, Credentials credentials) { try{ Credentials toSave = authServerLogic.userSignUp(credentials); context.setSecurityContext(new UserContext(context.getUriInfo(),toSave)); logger.info("SignUp Successful. Returning: " + toSave); return ok(toSave); } catch (ServerDAO.DAOException e) { logger.severe(ExceptionUtils.getStackTrace(e)); return fromDAOExpection(e); } catch (Exception e) { logger.severe(ExceptionUtils.getStackTrace(e)); return Response.serverError().build(); } }  @PostConstruct void init(); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response userSignUp(@Context ContainerRequestContext context, Credentials credentials); @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response userSignIn(@Context ContainerRequestContext context, Credentials credentials); @GET @Path("/key") @Produces(MediaType.APPLICATION_JSON) Response getPublicKey(); @GET @Path("/validate/{token}") @Produces(MediaType.APPLICATION_JSON) Response validateAccount(@PathParam("token") String token); @GET @Path("/from/{token}") @Produces(MediaType.APPLICATION_JSON) Response getUserFromToken(@Context ContainerRequestContext context, @PathParam("token") String token); @GET @Path("/recover/{token}") @Produces(MediaType.APPLICATION_JSON) Response recoverFromOneTimeToken(@Context ContainerRequestContext context, @PathParam("token") String token); @POST @Path("/user/data/{userId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response recieveUserData(@Context Session session, @PathParam("userId") String userId, Map<String,?> data); @PUT @Path("/user/data/{userId}") @Produces(MediaType.APPLICATION_JSON) Response sendUserData(@Context Session session, @PathParam("userId") String userId);  }