org.springframework.security.oauth2.client.web.server.UnAuthenticatedServerOAuth2AuthorizedClientRepository Java Examples

The following examples show how to use org.springframework.security.oauth2.client.web.server.UnAuthenticatedServerOAuth2AuthorizedClientRepository. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CredHubOAuth2AutoConfiguration.java    From spring-credhub with Apache License 2.0 5 votes vote down vote up
/**
 * Create a {@code ServerOAuth2AuthorizedClientRepository} bean for use with an
 * OAuth2-enabled {@code ReactiveCredHubTemplate}, to override the default provided by
 * {@link ReactiveOAuth2ClientAutoConfiguration}.
 * @return the {@code ServerOAuth2AuthorizedClientRepository}
 */
@Bean
@ConditionalOnMissingBean
@ConditionalOnClass(name = "org.springframework.web.reactive.function.client.WebClient")
public ServerOAuth2AuthorizedClientRepository credHubReactiveAuthorizedClientRepository() {
	return new UnAuthenticatedServerOAuth2AuthorizedClientRepository();
}
 
Example #2
Source File: WebClientConfig.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
WebClient webClient(ReactiveClientRegistrationRepository clientRegistrations) {
    ServerOAuth2AuthorizedClientExchangeFilterFunction oauth = new ServerOAuth2AuthorizedClientExchangeFilterFunction(clientRegistrations, new UnAuthenticatedServerOAuth2AuthorizedClientRepository());
    oauth.setDefaultClientRegistrationId("bael");
    return WebClient.builder()
        .filter(oauth)
        .build();
}