Class AuthenticationController
- java.lang.Object
-
- org.craftercms.profile.controllers.rest.AuthenticationController
-
@Controller @RequestMapping("/api/1/authentication") public class AuthenticationController extends Object
REST controller for the authentication service.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthenticationService
authenticationService
-
Constructor Summary
Constructors Constructor Description AuthenticationController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Ticket
authenticate(String tenantName, String username, String password)
PersistentLogin
createPersistentLogin(String profileId)
Ticket
createTicket(String profileId)
void
deletePersistentLogin(String loginId)
PersistentLogin
getPersistentLogin(String loginId)
Ticket
getTicket(String ticketId)
void
invalidateTicket(String ticketId)
PersistentLogin
refreshPersistentLoginToken(String loginId)
void
setAuthenticationService(AuthenticationService authenticationService)
-
-
-
Field Detail
-
authenticationService
protected AuthenticationService authenticationService
-
-
Method Detail
-
setAuthenticationService
public void setAuthenticationService(AuthenticationService authenticationService)
-
authenticate
@RequestMapping(value="/authenticate", method=POST) @ResponseBody public Ticket authenticate(@RequestParam("tenantName") String tenantName, @RequestParam("username") String username, @RequestParam("password") String password) throws ProfileException
- Throws:
ProfileException
-
createTicket
@RequestMapping(value="/ticket/create", method=POST) @ResponseBody public Ticket createTicket(@RequestParam("profileId") String profileId) throws ProfileException
- Throws:
ProfileException
-
getTicket
@RequestMapping(value="/ticket/{id}", method=GET) @ResponseBody public Ticket getTicket(@PathVariable("id") String ticketId) throws ProfileException
- Throws:
ProfileException
-
invalidateTicket
@RequestMapping(value="/ticket/{id}/invalidate", method=POST) @ResponseStatus(OK) public void invalidateTicket(@PathVariable("id") String ticketId) throws ProfileException
- Throws:
ProfileException
-
createPersistentLogin
@RequestMapping(value="/persistent_login/create", method=POST) @ResponseBody public PersistentLogin createPersistentLogin(@RequestParam("profileId") String profileId) throws ProfileException
- Throws:
ProfileException
-
getPersistentLogin
@RequestMapping(value="/persistent_login/{id}", method=GET) @ResponseBody public PersistentLogin getPersistentLogin(@PathVariable("id") String loginId) throws ProfileException
- Throws:
ProfileException
-
refreshPersistentLoginToken
@RequestMapping(value="/persistent_login/{id}/refresh_token", method=POST) @ResponseBody public PersistentLogin refreshPersistentLoginToken(@PathVariable("id") String loginId) throws ProfileException
- Throws:
ProfileException
-
deletePersistentLogin
@RequestMapping(value="/persistent_login/{id}/delete", method=POST) @ResponseStatus(OK) public void deletePersistentLogin(@PathVariable("id") String loginId) throws ProfileException
- Throws:
ProfileException
-
-