Class PasscodeEndpoint
- java.lang.Object
-
- com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint
-
@FrameworkRestController @FrameworkMapping("/passcode") public class PasscodeEndpoint extends Object
- Author:
- Cade Rea (cade-rea)
-
-
Constructor Summary
Constructors Constructor Description PasscodeEndpoint(PasscodeService<PasswordToken,User> passcodeService, UserService<User> userService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeResponse
consume(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String clientId, String passcode, String purpose, String username)
protected PasscodeService<PasswordToken,User>
getPasscodeService()
protected User
getUser(String clientId, String username)
protected UserService<User>
getUserService()
com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeStatusResponse
invalidate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String passcodeId)
protected void
passcodeConsumptionErrorHandler()
com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeResponse
retrieve(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String clientId, String purpose, String username)
com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeStatusResponse
status(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String passcodeId)
-
-
-
Field Detail
-
BASE_URI
public static final String BASE_URI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PasscodeEndpoint
public PasscodeEndpoint(PasscodeService<PasswordToken,User> passcodeService, UserService<User> userService)
-
-
Method Detail
-
retrieve
@Policy(permissionRoots="PASSCODE", operationTypes=CREATE) @FrameworkGetMapping("/retrieve") public com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeResponse retrieve(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("client_id") String clientId, @RequestParam("purpose") String purpose, @RequestParam("username") String username)
-
consume
@Policy(permissionRoots="PASSCODE", operationTypes=UPDATE) @FrameworkPostMapping(path="/consume", consumes="application/x-www-form-urlencoded") public com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeResponse consume(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("client_id") String clientId, @RequestParam("passcode") String passcode, @RequestParam("purpose") String purpose, @RequestParam("username") String username) throws PasscodeNotConsumedException
- Throws:
PasscodeNotConsumedException
-
passcodeConsumptionErrorHandler
@ResponseStatus(code=BAD_REQUEST, reason="Passcode not consumed.") @ExceptionHandler(PasscodeNotConsumedException.class) protected void passcodeConsumptionErrorHandler()
-
status
@Policy(permissionRoots="PASSCODE", operationTypes=READ) @FrameworkGetMapping("/status") public com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeStatusResponse status(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("passcode_id") String passcodeId)
-
invalidate
@Policy(permissionRoots="PASSCODE", operationTypes=DELETE) @FrameworkPostMapping(path="/invalidate", consumes="application/x-www-form-urlencoded") public com.broadleafcommerce.auth.user.web.endpoint.PasscodeEndpoint.PasscodeStatusResponse invalidate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("passcode_id") String passcodeId)
-
getUser
protected User getUser(@RequestParam("client_id") String clientId, @RequestParam("username") String username)
-
getPasscodeService
protected PasscodeService<PasswordToken,User> getPasscodeService()
-
getUserService
protected UserService<User> getUserService()
-
-