/** * Find the most appropriate consumer info renderer for the request and token. If none can be found from the * dynamically imported services, falls back to the {@code basicConsumerInformationRenderer}. * * @param request users request * @param token token being authorized * @return {@code ConsumerInformationRenderer} to use for rendering consumer info on authorization page */ private ConsumerInformationRenderer findConsumerInfoRenderer(HttpServletRequest request, ServiceProviderToken token) { try { return new DynamicSafeConsumerInformationRenderer(find(consumerInfoRenderers, canRender(token, request)), basicConsumerInformationRenderer); } catch (NoSuchElementException e) { return basicConsumerInformationRenderer; } }