@Path(value="/auth")
public final class AuthenticationEndpoint
extends java.lang.Object
Constructor and Description |
---|
AuthenticationEndpoint() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getPublicKey() |
javax.ws.rs.core.Response |
getUserFromToken(javax.ws.rs.container.ContainerRequestContext context,
java.lang.String token) |
void |
init() |
javax.ws.rs.core.Response |
recieveUserData(Session session,
java.lang.String userId,
java.util.Map<java.lang.String,?> data) |
javax.ws.rs.core.Response |
recoverFromOneTimeToken(javax.ws.rs.container.ContainerRequestContext context,
java.lang.String token) |
javax.ws.rs.core.Response |
sendUserData(Session session,
java.lang.String userId) |
javax.ws.rs.core.Response |
userSignIn(javax.ws.rs.container.ContainerRequestContext context,
Credentials credentials)
Checks username/password against that stored in DB, if same return
token, if token expired create new.
|
javax.ws.rs.core.Response |
userSignUp(javax.ws.rs.container.ContainerRequestContext context,
Credentials credentials) |
javax.ws.rs.core.Response |
validateAccount(java.lang.String token)
Validate a user account
|
@PostConstruct public void init()
@POST @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response userSignUp(@Context javax.ws.rs.container.ContainerRequestContext context, Credentials credentials)
@PUT @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response userSignIn(@Context javax.ws.rs.container.ContainerRequestContext context, Credentials credentials)
credentials
- @GET @Path(value="/key") @Produces(value="application/json") public javax.ws.rs.core.Response getPublicKey()
@GET @Path(value="/validate/{token}") @Produces(value="application/json") public javax.ws.rs.core.Response validateAccount(@PathParam(value="token") java.lang.String token)
token
- @GET @Path(value="/from/{token}") @Produces(value="application/json") public javax.ws.rs.core.Response getUserFromToken(@Context javax.ws.rs.container.ContainerRequestContext context, @PathParam(value="token") java.lang.String token)
@GET @Path(value="/recover/{token}") @Produces(value="application/json") public javax.ws.rs.core.Response recoverFromOneTimeToken(@Context javax.ws.rs.container.ContainerRequestContext context, @PathParam(value="token") java.lang.String token)
@POST @Path(value="/user/data/{userId}") @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response recieveUserData(@Context Session session, @PathParam(value="userId") java.lang.String userId, java.util.Map<java.lang.String,?> data)
@PUT @Path(value="/user/data/{userId}") @Produces(value="application/json") public javax.ws.rs.core.Response sendUserData(@Context Session session, @PathParam(value="userId") java.lang.String userId)