Class AuthenticationController
java.lang.Object
com.broadleafcommerce.auth.user.web.endpoint.AuthenticationController
- Author:
- Nathan Moore (nathanmoore).
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected final BroadleafClientRegistrationRepositoryprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationController(UserPasswordService<PasswordToken, User> userPasswordService, ClientRedirectService redirectService, UserLoginService loginService, UserLoginProperties properties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, BroadleafClientRegistrationRepository clientRegistrationRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddRememberMeAttributesToLoginPage(org.springframework.ui.Model loginModel) protected booleancanRedirectToRequestedUrl(String clientId, String requestedRedirectUrl) protected StringdetermineChangePasswordSuccessfulRedirectUrl(ChangePasswordForm changePasswordForm, String requestedRedirectUrl) protected StringdetermineLoggedInReturnUrl(String clientId, String redirectUrl) protected AuthCachePropertiesorg.springframework.web.servlet.ModelAndViewgetChangePasswordView(org.springframework.ui.Model model, ChangePasswordForm changePasswordForm, String redirectUrl) protected ClientIdentityProviderPropertiesgetClientProps(@NonNull AuthorizedClient client) protected BroadleafClientRegistrationRepositoryprotected AuthorizedClientService<AuthorizedClient>protected StringgetDefaultRedirectUrlForClient(String clientId) getLoginErrorView(org.springframework.ui.Model model, String clientId) protected UserLoginServicegetLoginView(org.springframework.ui.Model model, String clientId) protected List<OAuth2IdentityProvider>getOauth2AuthenticationProviders(@NonNull AuthorizedClient client) Looks at theClientRegistrationsto determine which providers are configured and then cross-checks that with theClientIdentityProviderProperties.ClientPropertiesfor the appropriate type ofAuthorizedClientthat is making a request, either admin or commerce, to filter the registered identity providers that are appropriate to show the user.protected UserLoginPropertiesgetPwResetEmailView(org.springframework.ui.Model model, String redirectUrl, boolean credentialsExpired, String clientId) protected ClientRedirectServiceprotected RememberMeLoginPropertiesgetResetPasswordSuccessView(String clientId) org.springframework.web.servlet.ModelAndViewgetResetPasswordView(org.springframework.ui.Model model, String redirectUrl, String clientId) protected com.broadleafcommerce.common.extension.TypeFactoryprotected UserPasswordService<PasswordToken,User> protected booleanisRequestedRedirectUrlValid(String clientId, @NonNull String requestedRedirectUrl) org.springframework.web.servlet.ModelAndViewprocessChangePasswordRequest(jakarta.servlet.http.HttpServletRequest request, ChangePasswordForm changePasswordForm, String redirectUrl, org.springframework.validation.BindingResult errors, org.springframework.ui.Model model, jakarta.servlet.http.HttpServletResponse httpServletResponse) processPwResetEmailRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.ui.Model model, String redirectUrl, String clientId, PasswordResetEmailRequestDTO request) protected StringprocessPwResetEmailRequest(org.springframework.ui.Model model, PasswordResetEmailRequestDTO request) processPwResetEmailRequest(org.springframework.ui.Model model, String redirectUrl, String username, String clientId) Deprecated, for removal: This API element is subject to removal in a future version.org.springframework.web.servlet.ModelAndViewprocessResetPasswordRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, ResetPasswordForm resetPasswordForm, String redirectUrl, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.springframework.validation.BindingResult errors) voidsetAuthCacheProperties(AuthCacheProperties authCacheProperties) voidsetRememberMeLoginProperties(RememberMeLoginProperties rememberMeLoginProperties)
-
Field Details
-
REQUEST_PASSWORD_RESET_EMAIL_VIEW
- See Also:
-
LOGIN_VIEW
- See Also:
-
RESET_PASSWORD_VIEW
- See Also:
-
RESET_PASSWORD_SUCCESS_VIEW
- See Also:
-
CHANGE_PASSWORD_VIEW
- See Also:
-
CHANGE_PASSWORD_SUCCESS_VIEW
- See Also:
-
SENT_RESET_PASSWORD_VIEW
- See Also:
-
ADMIN_PROVIDERS_KEY
- See Also:
-
COMMERCE_PROVIDERS_KEY
- See Also:
-
AUTHORIZATION_REQUEST_BASE_URI
- See Also:
-
clientRegistrationRepository
-
-
Constructor Details
-
AuthenticationController
public AuthenticationController(UserPasswordService<PasswordToken, User> userPasswordService, ClientRedirectService redirectService, UserLoginService loginService, UserLoginProperties properties, AuthorizedClientService<AuthorizedClient> clientService, ClientIdentityProviderProperties clientProperties, BroadleafClientRegistrationRepository clientRegistrationRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
getLoginView
-
addRememberMeAttributesToLoginPage
protected void addRememberMeAttributesToLoginPage(org.springframework.ui.Model loginModel) -
getLoginErrorView
-
getPwResetEmailView
-
processPwResetEmailRequest
@Deprecated(forRemoval=true, since="2.1.4") @FrameworkPostMapping(path="/request-password-reset") public String processPwResetEmailRequest(org.springframework.ui.Model model, @RequestParam(value="returnTo",required=false) String redirectUrl, @RequestParam("username") String username, @RequestParam("client_id") String clientId) Deprecated, for removal: This API element is subject to removal in a future version. -
processPwResetEmailRequest
@FrameworkPostMapping(path="/request-password-reset", headers="Accept-Version=2") public String processPwResetEmailRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.ui.Model model, @RequestParam(value="returnTo",required=false) String redirectUrl, @RequestParam("client_id") String clientId, @ModelAttribute PasswordResetEmailRequestDTO request) -
processPwResetEmailRequest
protected String processPwResetEmailRequest(org.springframework.ui.Model model, PasswordResetEmailRequestDTO request) -
getResetPasswordSuccessView
-
getResetPasswordView
-
processResetPasswordRequest
@FrameworkPostMapping("/reset-password") public org.springframework.web.servlet.ModelAndView processResetPasswordRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, @ModelAttribute ResetPasswordForm resetPasswordForm, @RequestParam(value="returnTo",required=false) String redirectUrl, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, org.springframework.validation.BindingResult errors) -
getOauth2AuthenticationProviders
protected List<OAuth2IdentityProvider> getOauth2AuthenticationProviders(@NonNull @NonNull AuthorizedClient client) Looks at theClientRegistrationsto determine which providers are configured and then cross-checks that with theClientIdentityProviderProperties.ClientPropertiesfor the appropriate type ofAuthorizedClientthat is making a request, either admin or commerce, to filter the registered identity providers that are appropriate to show the user.- Parameters:
client- The requestingAuthorizedClient.- Returns:
- A list of
OAuth2IdentityProviderto add to the request model.
-
getClientProps
protected ClientIdentityProviderProperties.ClientProperties getClientProps(@NonNull @NonNull AuthorizedClient client) -
determineLoggedInReturnUrl
-
canRedirectToRequestedUrl
-
isRequestedRedirectUrlValid
-
getDefaultRedirectUrlForClient
-
getChangePasswordView
@FrameworkGetMapping("/change-password") public org.springframework.web.servlet.ModelAndView getChangePasswordView(org.springframework.ui.Model model, @ModelAttribute ChangePasswordForm changePasswordForm, @RequestParam(value="returnTo",required=false) String redirectUrl) -
processChangePasswordRequest
@FrameworkPostMapping("/change-password") public org.springframework.web.servlet.ModelAndView processChangePasswordRequest(jakarta.servlet.http.HttpServletRequest request, @ModelAttribute ChangePasswordForm changePasswordForm, @RequestParam(value="returnTo",required=false) String redirectUrl, org.springframework.validation.BindingResult errors, org.springframework.ui.Model model, jakarta.servlet.http.HttpServletResponse httpServletResponse) -
determineChangePasswordSuccessfulRedirectUrl
protected String determineChangePasswordSuccessfulRedirectUrl(ChangePasswordForm changePasswordForm, String requestedRedirectUrl) -
getChangePasswordSuccessView
@FrameworkGetMapping(path="/change-password-confirmation") public String getChangePasswordSuccessView() -
getUserPasswordService
-
getRedirectService
-
getLoginService
-
getProperties
-
getClientService
-
getClientProperties
-
getAuthCacheProperties
-
setAuthCacheProperties
@Autowired(required=false) public void setAuthCacheProperties(AuthCacheProperties authCacheProperties) -
getRememberMeLoginProperties
-
setRememberMeLoginProperties
@Autowired(required=false) public void setRememberMeLoginProperties(RememberMeLoginProperties rememberMeLoginProperties) -
getClientRegistrationRepository
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
processPwResetEmailRequest(HttpServletRequest, Model, String, String, PasswordResetEmailRequestDTO)