Search in sources :

Example 1 with OAuth2AuthorizedClientService

use of org.springframework.security.oauth2.client.OAuth2AuthorizedClientService in project spring-security by spring-projects.

the class OAuth2ClientConfigurer method authorizedClientService.

/**
 * Sets the service for authorized client(s).
 * @param authorizedClientService the authorized client service
 * @return the {@link OAuth2ClientConfigurer} for further configuration
 */
public OAuth2ClientConfigurer<B> authorizedClientService(OAuth2AuthorizedClientService authorizedClientService) {
    Assert.notNull(authorizedClientService, "authorizedClientService cannot be null");
    this.authorizedClientRepository(new AuthenticatedPrincipalOAuth2AuthorizedClientRepository(authorizedClientService));
    return this;
}
Also used : AuthenticatedPrincipalOAuth2AuthorizedClientRepository(org.springframework.security.oauth2.client.web.AuthenticatedPrincipalOAuth2AuthorizedClientRepository)

Example 2 with OAuth2AuthorizedClientService

use of org.springframework.security.oauth2.client.OAuth2AuthorizedClientService in project spring-security by spring-projects.

the class OAuth2LoginConfigurer method authorizedClientService.

/**
 * Sets the service for authorized client(s).
 * @param authorizedClientService the authorized client service
 * @return the {@link OAuth2LoginConfigurer} for further configuration
 */
public OAuth2LoginConfigurer<B> authorizedClientService(OAuth2AuthorizedClientService authorizedClientService) {
    Assert.notNull(authorizedClientService, "authorizedClientService cannot be null");
    this.authorizedClientRepository(new AuthenticatedPrincipalOAuth2AuthorizedClientRepository(authorizedClientService));
    return this;
}
Also used : AuthenticatedPrincipalOAuth2AuthorizedClientRepository(org.springframework.security.oauth2.client.web.AuthenticatedPrincipalOAuth2AuthorizedClientRepository)

Aggregations

AuthenticatedPrincipalOAuth2AuthorizedClientRepository (org.springframework.security.oauth2.client.web.AuthenticatedPrincipalOAuth2AuthorizedClientRepository)2