code: @Bean
  	@ConditionalOnMissingBean
  	public CredHubOperations credHubTemplate(
  			CredHubProperties credHubProperties, ClientOptions clientOptions,
  			@Autowired(required = false) ClientRegistrationRepository clientRegistrationRepository,
  			@Autowired(required = false) OAuth2AuthorizedClientService authorizedClientService) {
  
  		if (credHubProperties.getOauth2() == null || credHubProperties.getOauth2().getRegistrationId() == null) {
  			return credHubTemplateFactory.credHubTemplate(credHubProperties, clientOptions);
  		}
  
  		if (clientRegistrationRepository == null || authorizedClientService == null) {
  			throw misconfiguredException();
  		}
  
  		return credHubTemplateFactory.credHubTemplate(credHubProperties, clientOptions,
  				clientRegistrationRepository, authorizedClientService);
  	}
docs: Create the {@link CredHubTemplate} that the application will use to interact
  with CredHub.
  
  @param credHubProperties            {@link CredHubProperties} for CredHub
  @param clientOptions                client connection options
  @param clientRegistrationRepository a repository of OAuth2 client registrations
  @param authorizedClientService      a repository of authorized OAuth2 clients
  @return the {@link CredHubOperations} bean