// If we have found a set of provider ids which the user needs to connect with for this request, select one of them and send the user to the connect/<provider> page
AccessDeniedHandlerImpl providerSpecificAccessDeniedHandler
= new AccessDeniedHandlerImpl();
request.setAttribute(REQUIRED_PROVIDERS_REQUEST_ATTRIBUTE_NAME, requiredProviderIds);
providerSpecificAccessDeniedHandler.setErrorPage(connectWithProviderUrlPrefix + "/" + requiredProviderIds.iterator().next());
providerSpecificAccessDeniedHandler.handle(request, response, accessDeniedException);
}
else
{
if (defaultAccessDeniedUrl != null)
{