@Path(value="/login") public class LoginResource extends Object
Constructor and Description |
---|
LoginResource() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createAccount(String email,
String personId,
String password)
Create a user account by either specifying the email or the personId and
a password
|
void |
deleteToken(org.jboss.resteasy.spi.HttpRequest request) |
javax.ws.rs.core.Response |
disable(org.jboss.resteasy.spi.HttpRequest request,
String email)
Delete the account given the specific id.
|
javax.ws.rs.core.Response |
getKey(String auth)
Gets the key/token associated with a user account
|
javax.ws.rs.core.Response |
login(String email,
String auth)
Login a user by email and authorization string
|
javax.ws.rs.core.Response |
updateAccount(org.jboss.resteasy.spi.HttpRequest request,
String personId)
Enable/Disable user accounts
|
javax.ws.rs.core.Response |
updateAccountPassword(String auth,
String password) |
@GET @Produces(value="application/json") public javax.ws.rs.core.Response login(@QueryParam(value="email") String email, @HeaderParam(value="Authorization") String auth) throws Exception
email
- email of the user attempting to authenticateauth
- authentication string/tokenException
@GET @Path(value="key") @Produces(value="application/json") public javax.ws.rs.core.Response getKey(@HeaderParam(value="Authorization") String auth) throws Exception
auth
- - Authorization header with username/passwordException
@POST @Produces(value="text/plain") public javax.ws.rs.core.Response createAccount(@QueryParam(value="email") @DefaultValue(value="") String email, @QueryParam(value="personId") @DefaultValue(value="") String personId, @QueryParam(value="password") String password) throws Exception
email
- email of the account to createpersonId
- - the ID of the person to create the account forpassword
- password for the user accountException
- If email or personId and password are not specified or if
user does not exist@POST @Path(value="updatePassword") @Produces(value="text/plain") public javax.ws.rs.core.Response updateAccountPassword(@HeaderParam(value="Authorization") String auth, @QueryParam(value="password") String password) throws Exception
Exception
@PUT @Path(value="{person-id}/active") @Produces(value="text/plain") public javax.ws.rs.core.Response updateAccount(@Context org.jboss.resteasy.spi.HttpRequest request, @PathParam(value="person-id") String personId)
request
- - Request body with key-value pair for active attributepersonId
- - User account to update@DELETE @Path(value="token") @Produces(value="application/json") public void deleteToken(@Context org.jboss.resteasy.spi.HttpRequest request)
@DELETE public javax.ws.rs.core.Response disable(@Context org.jboss.resteasy.spi.HttpRequest request, @QueryParam(value="email") @DefaultValue(value="") String email) throws Exception
email
- the email for whom the account to be deletedException
Copyright © 2020. All rights reserved.