Class RestAuthService
- java.lang.Object
-
- com.logicaldoc.webservice.AbstractService
-
- com.logicaldoc.webservice.soap.endpoint.SoapAuthService
-
- com.logicaldoc.webservice.rest.endpoint.RestAuthService
-
- All Implemented Interfaces:
AuthService
,AuthService
- Direct Known Subclasses:
RestAuthSwagger
@Path("/") @Consumes({"application/xml","application/json"}) @Produces("application/json") public class RestAuthService extends SoapAuthService implements AuthService
-
-
Constructor Summary
Constructors Constructor Description RestAuthService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getSid()
String
login(String username, String password)
Starts a new session.String
loginPost(String username, String password)
String
loginPostJSON(String jsonstr)
void
logout(String sid)
Closes a session.void
setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext messageContext)
-
Methods inherited from class com.logicaldoc.webservice.soap.endpoint.SoapAuthService
renew, valid
-
Methods inherited from class com.logicaldoc.webservice.AbstractService
convertDateToString, convertStringToDate, getContext, getMessageContext, isValidateSession, setContext, setValidateSession
-
-
-
-
Method Detail
-
setMessageContext
@Context public void setMessageContext(org.apache.cxf.jaxrs.ext.MessageContext messageContext)
- Overrides:
setMessageContext
in classAbstractService
-
login
@GET @Path("/login") public String login(@QueryParam("u") String username, @QueryParam("pw") String password) throws Exception
Description copied from interface:AuthService
Starts a new session.- Specified by:
login
in interfaceAuthService
- Specified by:
login
in interfaceAuthService
- Overrides:
login
in classSoapAuthService
- Parameters:
username
- The usernamepassword
- The password- Returns:
- The newly created session identifier(sid)
- Throws:
Exception
- error in the server application
-
loginPost
@POST @Path("/login") @Consumes("application/x-www-form-urlencoded") public String loginPost(@FormParam("username") String username, @FormParam("password") String password) throws Exception
- Specified by:
loginPost
in interfaceAuthService
- Throws:
Exception
-
loginPostJSON
@POST @Path("/login") @Consumes("application/json") public String loginPostJSON(String jsonstr) throws Exception
- Specified by:
loginPostJSON
in interfaceAuthService
- Throws:
Exception
-
logout
@DELETE @Path("/logout") public void logout(@QueryParam("sid") String sid)
Description copied from interface:AuthService
Closes a session.- Specified by:
logout
in interfaceAuthService
- Specified by:
logout
in interfaceAuthService
- Overrides:
logout
in classSoapAuthService
- Parameters:
sid
- The session identifier
-
getSid
@GET @Path("/getSid") public String getSid()
- Specified by:
getSid
in interfaceAuthService
-
-