Class RegistrationFormController
- java.lang.Object
-
- com.broadleafcommerce.auth.user.web.endpoint.RegistrationFormController
-
@FrameworkController @FrameworkMapping("/register") public class RegistrationFormController extends Object
Controller for supporting form-based registration for Universal Login.- Author:
- Cade Rea (cade-rea)
- See Also:
for handling embedded login.
-
-
Field Summary
Fields Modifier and Type Field Description static String
REGISTER_VIEW
-
Constructor Summary
Constructors Constructor Description RegistrationFormController(UserRegistrationService<User> registrationService, AuthenticationLogoutHandler authenticationLogoutHandler, AuthorizedClientService<AuthorizedClient> clientService, UserLoginProperties properties, ClientRedirectService redirectService, UserLoginService loginService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAttributesToForm(org.springframework.util.MultiValueMap<String,String> attributes, UserRegistration userRegistration)
Adds attributes from the request parameter MultiValueMap to the user registration form.protected void
addFlashAttributesToModel(javax.servlet.http.HttpServletRequest request, org.springframework.ui.Model model)
Add flash attributes passed from the /submit endpoint to the Modelprotected void
addFlashAttributeToModel(org.springframework.ui.Model model, Map<String,?> inputFlashMap, String attributeKey)
Add a flash attribute to the model if it exists.protected String
determineLoggedInReturnUrl(UserRegistration userRegistration)
protected AuthenticationLogoutHandler
getAuthenticationLogoutHandler()
protected AuthorizedClientService<AuthorizedClient>
getClientService()
protected UserLoginService
getLoginService()
protected UserLoginProperties
getProperties()
protected ClientRedirectService
getRedirectService()
protected UserRegistrationService<User>
getRegistrationService()
org.springframework.web.servlet.view.RedirectView
registerUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String clientId, UserRegistration userRegistration, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
String
showRegisterForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String clientId, String redirectUrl, UserRegistration userRegistration, org.springframework.validation.BindingResult bindingResult, org.springframework.util.MultiValueMap<String,String> attributes)
-
-
-
Field Detail
-
REGISTER_VIEW
public static final String REGISTER_VIEW
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RegistrationFormController
public RegistrationFormController(UserRegistrationService<User> registrationService, AuthenticationLogoutHandler authenticationLogoutHandler, AuthorizedClientService<AuthorizedClient> clientService, UserLoginProperties properties, ClientRedirectService redirectService, UserLoginService loginService)
-
-
Method Detail
-
showRegisterForm
@FrameworkGetMapping public String showRegisterForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @RequestParam("client_id") String clientId, @RequestParam(value="returnTo",required=false) String redirectUrl, @ModelAttribute UserRegistration userRegistration, org.springframework.validation.BindingResult bindingResult, @RequestParam org.springframework.util.MultiValueMap<String,String> attributes)
-
addAttributesToForm
protected void addAttributesToForm(org.springframework.util.MultiValueMap<String,String> attributes, UserRegistration userRegistration)
Adds attributes from the request parameter MultiValueMap to the user registration form. The client_id parameter will be ignored and not added to the attributes map. If the List from MultiValueMap.Entry.value has a single value, the single item will added to the attributes map and not the List- Parameters:
attributes
-userRegistration
-
-
registerUser
@FrameworkPostMapping("/submit") public org.springframework.web.servlet.view.RedirectView registerUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @RequestParam("client_id") String clientId, @ModelAttribute UserRegistration userRegistration, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
determineLoggedInReturnUrl
protected String determineLoggedInReturnUrl(UserRegistration userRegistration)
-
addFlashAttributesToModel
protected void addFlashAttributesToModel(javax.servlet.http.HttpServletRequest request, org.springframework.ui.Model model)
Add flash attributes passed from the /submit endpoint to the Model- Parameters:
request
-model
-
-
addFlashAttributeToModel
protected void addFlashAttributeToModel(org.springframework.ui.Model model, Map<String,?> inputFlashMap, String attributeKey)
Add a flash attribute to the model if it exists. Use the same key for the flash map and Model attribute.- Parameters:
model
-inputFlashMap
-attributeKey
-
-
getRegistrationService
protected UserRegistrationService<User> getRegistrationService()
-
getAuthenticationLogoutHandler
protected AuthenticationLogoutHandler getAuthenticationLogoutHandler()
-
getClientService
protected AuthorizedClientService<AuthorizedClient> getClientService()
-
getProperties
protected UserLoginProperties getProperties()
-
getRedirectService
protected ClientRedirectService getRedirectService()
-
getLoginService
protected UserLoginService getLoginService()
-
-