@FrameworkController public class AuthenticationController extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AuthenticationController.ModelAttributes |
Modifier and Type | Field and Description |
---|---|
protected static String |
ADMIN_PROVIDERS_KEY |
static String |
AUTHORIZATION_REQUEST_BASE_URI |
protected static String |
CHANGE_PASSWORD_SUCCESS_VIEW |
protected static String |
CHANGE_PASSWORD_VIEW |
protected BroadleafClientRegistrationRepository |
clientRegistrationRepository |
protected static String |
COMMERCE_PROVIDERS_KEY |
protected static String |
LOGIN_VIEW |
protected static String |
REQUEST_PASSWORD_RESET_EMAIL_VIEW |
protected static String |
RESET_PASSWORD_SUCCESS_VIEW |
protected static String |
RESET_PASSWORD_VIEW |
protected static String |
SENT_RESET_PASSWORD_VIEW |
Constructor and Description |
---|
AuthenticationController(UserPasswordService<PasswordToken,User> userPasswordService,
ClientRedirectService redirectService,
UserLoginService loginService,
UserLoginProperties properties,
AuthorizedClientService<AuthorizedClient> clientService,
ClientIdentityProviderProperties clientProperties,
BroadleafClientRegistrationRepository clientRegistrationRepository,
com.broadleafcommerce.common.extension.TypeFactory typeFactory) |
Modifier and Type | Method and Description |
---|---|
protected String |
determineLoggedInReturnUrl(String clientId,
String redirectUrl) |
String |
getChangePasswordSuccessView() |
org.springframework.web.servlet.ModelAndView |
getChangePasswordView(org.springframework.ui.Model model,
ChangePasswordForm changePasswordForm,
String redirectUrl) |
protected ClientIdentityProviderProperties |
getClientProperties() |
protected BroadleafClientRegistrationRepository |
getClientRegistrationRepository() |
protected AuthorizedClientService<AuthorizedClient> |
getClientService() |
String |
getLoginErrorView(org.springframework.ui.Model model,
String clientId) |
protected UserLoginService |
getLoginService() |
String |
getLoginView(org.springframework.ui.Model model,
String clientId) |
protected Map<String,List<OAuth2IdentityProvider>> |
getOath2AuthenticationProviders()
Provides caching by the type of authorized client for the appropriate
OAuth2IdentityProvider for it. |
protected List<OAuth2IdentityProvider> |
getOath2AuthenticationProviders(@NonNull ClientIdentityProviderProperties.ClientProperties properties,
boolean isAdmin)
Looks at the
ClientRegistrations to determine which providers are
configured and then cross-checks that with the ClientIdentityProviderProperties.ClientProperties for the appropriate
type of AuthorizedClient that is making a request, either admin or commerce, to
filter the registered identity providers that are appropriate to show the user. |
protected UserLoginProperties |
getProperties() |
String |
getPwResetEmailView(org.springframework.ui.Model model,
String redirectUrl,
boolean credentialsExpired,
String clientId) |
protected ClientRedirectService |
getRedirectService() |
String |
getResetPasswordSuccessView(String clientId) |
org.springframework.web.servlet.ModelAndView |
getResetPasswordView(org.springframework.ui.Model model,
String redirectUrl,
String clientId) |
protected com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
protected UserPasswordService<PasswordToken,User> |
getUserPasswordService() |
org.springframework.web.servlet.ModelAndView |
processChangePasswordRequest(javax.servlet.http.HttpServletRequest request,
ChangePasswordForm changePasswordForm,
String redirectUrl,
org.springframework.validation.BindingResult errors,
org.springframework.ui.Model model,
javax.servlet.http.HttpServletResponse httpServletResponse) |
String |
processPwResetEmailRequest(org.springframework.ui.Model model,
String redirectUrl,
String username,
String clientId) |
org.springframework.web.servlet.ModelAndView |
processResetPasswordRequest(javax.servlet.http.HttpServletRequest request,
javax.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) |
protected static final String REQUEST_PASSWORD_RESET_EMAIL_VIEW
protected static final String LOGIN_VIEW
protected static final String RESET_PASSWORD_VIEW
protected static final String RESET_PASSWORD_SUCCESS_VIEW
protected static final String CHANGE_PASSWORD_VIEW
protected static final String CHANGE_PASSWORD_SUCCESS_VIEW
protected static final String SENT_RESET_PASSWORD_VIEW
protected static final String ADMIN_PROVIDERS_KEY
protected static final String COMMERCE_PROVIDERS_KEY
public static final String AUTHORIZATION_REQUEST_BASE_URI
protected final BroadleafClientRegistrationRepository clientRegistrationRepository
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)
@FrameworkGetMapping(path="/login") public String getLoginView(org.springframework.ui.Model model, @RequestParam(value="client_id") String clientId)
@FrameworkGetMapping(path="/login", params="error=true") public String getLoginErrorView(org.springframework.ui.Model model, @RequestParam(value="client_id") String clientId)
@FrameworkGetMapping(value="/request-password-reset") public String getPwResetEmailView(org.springframework.ui.Model model, @RequestParam(value="returnTo",required=false) String redirectUrl, @RequestParam(defaultValue="false") boolean credentialsExpired, @RequestParam(value="client_id") String clientId)
@FrameworkPostMapping(value="/request-password-reset") public String processPwResetEmailRequest(org.springframework.ui.Model model, @RequestParam(value="returnTo",required=false) String redirectUrl, @RequestParam(value="username") String username, @RequestParam(value="client_id") String clientId)
@FrameworkGetMapping(path="/reset-password-confirmation") public String getResetPasswordSuccessView(@RequestParam(value="client_id") String clientId)
@FrameworkGetMapping(value="/reset-password") public org.springframework.web.servlet.ModelAndView getResetPasswordView(org.springframework.ui.Model model, @RequestParam(value="returnTo",required=false) String redirectUrl, @RequestParam(value="client_id") String clientId)
@FrameworkPostMapping(value="/reset-password") public org.springframework.web.servlet.ModelAndView processResetPasswordRequest(javax.servlet.http.HttpServletRequest request, javax.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)
protected List<OAuth2IdentityProvider> getOath2AuthenticationProviders(@NonNull @NonNull ClientIdentityProviderProperties.ClientProperties properties, boolean isAdmin)
ClientRegistrations
to determine which providers are
configured and then cross-checks that with the ClientIdentityProviderProperties.ClientProperties
for the appropriate
type of AuthorizedClient
that is making a request, either admin or commerce, to
filter the registered identity providers that are appropriate to show the user.properties
- The ClientIdentityProviderProperties.ClientProperties
appropriate for the requesting client, admin
or commerce.isAdmin
- Whether the client was an admin (see AuthorizedClient.isAdmin()
)OAuth2IdentityProvider
to add to the request model.which is used for caching the result.
protected String determineLoggedInReturnUrl(String clientId, String redirectUrl)
@FrameworkGetMapping(value="/change-password") public org.springframework.web.servlet.ModelAndView getChangePasswordView(org.springframework.ui.Model model, @ModelAttribute ChangePasswordForm changePasswordForm, @RequestParam(value="returnTo",required=false) String redirectUrl)
@FrameworkPostMapping(value="/change-password") public org.springframework.web.servlet.ModelAndView processChangePasswordRequest(javax.servlet.http.HttpServletRequest request, @ModelAttribute ChangePasswordForm changePasswordForm, @RequestParam(value="returnTo",required=false) String redirectUrl, org.springframework.validation.BindingResult errors, org.springframework.ui.Model model, javax.servlet.http.HttpServletResponse httpServletResponse)
@FrameworkGetMapping(path="/change-password-confirmation") public String getChangePasswordSuccessView()
protected UserPasswordService<PasswordToken,User> getUserPasswordService()
protected ClientRedirectService getRedirectService()
protected UserLoginService getLoginService()
protected UserLoginProperties getProperties()
protected AuthorizedClientService<AuthorizedClient> getClientService()
protected ClientIdentityProviderProperties getClientProperties()
protected BroadleafClientRegistrationRepository getClientRegistrationRepository()
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
protected Map<String,List<OAuth2IdentityProvider>> getOath2AuthenticationProviders()
OAuth2IdentityProvider
for it.#getOath2AuthenticationProviders(ClientProperties, boolean)
Copyright © 2021. All rights reserved.