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 StringgetSid()Stringlogin(String username, String password)Starts a new session.StringloginForm(String username, String password)StringloginPostJSON(WSCredentials cred)voidlogout(String sid)Closes a session.voidrenew()Renews the current sessionvoidrenew(String sid)Renews a sessionvoidsetMessageContext(org.apache.cxf.jaxrs.ext.MessageContext messageContext)-
Methods inherited from class com.logicaldoc.webservice.soap.endpoint.SoapAuthService
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:
setMessageContextin classAbstractService
-
login
@GET @Path("/login") public String login(@QueryParam("u") String username, @QueryParam("pw") String password) throws AuthenticationExceptionDescription copied from interface:AuthServiceStarts a new session.- Specified by:
loginin interfaceAuthService- Specified by:
loginin interfaceAuthService- Overrides:
loginin classSoapAuthService- Parameters:
username- The usernamepassword- The password- Returns:
- The newly created session identifier(sid)
- Throws:
AuthenticationException- the user was not authenticated
-
loginForm
@POST @Path("/loginForm") @Consumes("application/x-www-form-urlencoded") public String loginForm(@FormParam("username") String username, @FormParam("password") String password) throws Exception- Specified by:
loginFormin interfaceAuthService- Throws:
Exception
-
loginPostJSON
@POST @Path("/login") @Consumes("application/json") public String loginPostJSON(WSCredentials cred) throws Exception- Specified by:
loginPostJSONin interfaceAuthService- Throws:
Exception
-
logout
@DELETE @Path("/logout") public void logout(@QueryParam("sid") String sid)Description copied from interface:AuthServiceCloses a session.- Specified by:
logoutin interfaceAuthService- Specified by:
logoutin interfaceAuthService- Overrides:
logoutin classSoapAuthService- Parameters:
sid- The session identifier
-
getSid
@GET @Path("/getSid") @Produces({"application/json","text/plain"}) public String getSid()- Specified by:
getSidin interfaceAuthService
-
renew
@GET @Path("/renew") public void renew(@QueryParam("sid") String sid)Renews a session- Specified by:
renewin interfaceAuthService- Overrides:
renewin classSoapAuthService- Parameters:
sid- identifier of the session
-
renew
@GET @Path("/renewcurrent") public void renew()Renews the current session
-
-