Java Code Examples for org.springframework.security.oauth2.provider.OAuth2RequestFactory

The following examples show how to use org.springframework.security.oauth2.provider.OAuth2RequestFactory. These examples are extracted from open source projects. 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
@Bean
public ResourceOwnerPasswordTokenGranter resourceOwnerPasswordTokenGranter(AuthenticationManager authenticationManager, OAuth2RequestFactory oAuth2RequestFactory) {
    DefaultTokenServices defaultTokenServices = defaultTokenServices();
    if (properties.getEnableJwt()) {
        defaultTokenServices.setTokenEnhancer(jwtAccessTokenConverter());
    }
    return new ResourceOwnerPasswordTokenGranter(authenticationManager, defaultTokenServices, redisClientDetailsService, oAuth2RequestFactory);
}
 
Example 2
Source Project: spring-cloud-gray   Source File: OAuth2Config.java    License: Apache License 2.0 5 votes vote down vote up
@Bean
public Oauth2Service oauth2Service(
        ClientDetailsService clientDetailsService,
        OAuth2RequestFactory requestFactory,
        DefaultTokenGranter defaultTokenGranter) {
    return new Oauth2Service(clientDetailsService, requestFactory, defaultTokenGranter);
}
 
Example 3
Source Project: spring-cloud-shop   Source File: OAuth2SecurityConfiguration.java    License: MIT License 5 votes vote down vote up
private List<TokenGranter> getTokenGranters(AuthorizationCodeServices authorizationCodeServices,
                                            AuthorizationServerTokenServices tokenServices,
                                            ClientDetailsService clientDetailsService,
                                            OAuth2RequestFactory requestFactory) {
    return Stream.of(
            new ClientCredentialsTokenGranter(tokenServices, clientDetailsService, requestFactory),
            new ResourceOwnerPasswordTokenGranter(authenticationManager, tokenServices, clientDetailsService, requestFactory),
            new PhonePasswordTokenGranter(authenticationManager, tokenServices, clientDetailsService, requestFactory),
            new AuthorizationCodeTokenGranter(tokenServices, authorizationCodeServices, clientDetailsService, requestFactory),
            new SmsTokenGranter(userServiceImpl, tokenServices, clientDetailsService, requestFactory))
            .collect(Collectors.toList());
}
 
Example 4
public CustomResourceOwnerPasswordTokenGranter(
    AuthenticationManager authenticationManager,
    AuthorizationServerTokenServices tokenServices,
    ClientDetailsService clientDetailsService,
    OAuth2RequestFactory requestFactory) {
  this(authenticationManager, tokenServices, clientDetailsService,
      requestFactory, GRANT_TYPE);
}
 
Example 5
protected CustomResourceOwnerPasswordTokenGranter(
    AuthenticationManager authenticationManager,
    AuthorizationServerTokenServices tokenServices,
    ClientDetailsService clientDetailsService,
    OAuth2RequestFactory requestFactory, String grantType) {
  super(tokenServices, clientDetailsService, requestFactory, grantType);
  this.authenticationManager = authenticationManager;
}
 
Example 6
public LessStrictRedirectUriAuthorizationCodeTokenGranter(
        AuthorizationServerTokenServices tokenServices,
        AuthorizationCodeServices authorizationCodeServices,
        ClientDetailsService clientDetailsService,
        OAuth2RequestFactory requestFactory
) {
    super(tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
    this.authorizationCodeServices = authorizationCodeServices;
}
 
Example 7
Source Project: spring-cloud-gray   Source File: OAuth2Config.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public OAuth2RequestFactory requestFactory(ClientDetailsService clientDetailsService) {
    return new DefaultOAuth2RequestFactory(clientDetailsService);
}
 
Example 8
Source Project: spring-cloud-gray   Source File: OAuth2Config.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public RefreshTokenGranter refreshTokenGranter(AuthorizationServerTokenServices tokenServices,
                                               ClientDetailsService clientDetailsService,
                                               OAuth2RequestFactory requestFactory) {
    return new RefreshTokenGranter(tokenServices, clientDetailsService, requestFactory);
}
 
Example 9
Source Project: spring-cloud-gray   Source File: OAuth2Config.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public DefaultTokenGranter defaultTokenGranter(AuthorizationServerTokenServices tokenServices,
                                               ClientDetailsService clientDetailsService,
                                               OAuth2RequestFactory requestFactory) {
    return new DefaultTokenGranter(tokenServices, clientDetailsService, requestFactory);
}
 
Example 10
Source Project: spring-cloud-shop   Source File: SmsTokenGranter.java    License: MIT License 4 votes vote down vote up
public SmsTokenGranter(UserServiceImpl userService, AuthorizationServerTokenServices tokenServices,
                       ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory) {
    this(tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
    this.userService = userService;
}
 
Example 11
Source Project: spring-cloud-shop   Source File: SmsTokenGranter.java    License: MIT License 4 votes vote down vote up
protected SmsTokenGranter(AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService,
                          OAuth2RequestFactory requestFactory, String grantType) {
    super(tokenServices, clientDetailsService, requestFactory, grantType);
    this.requestFactory = requestFactory;
}
 
Example 12
Source Project: spring-cloud-shop   Source File: SmsTokenGranter.java    License: MIT License 4 votes vote down vote up
@Override
public OAuth2RequestFactory getRequestFactory() {
    return requestFactory;
}
 
Example 13
Source Project: spring-cloud-shop   Source File: SmsTokenGranter.java    License: MIT License 4 votes vote down vote up
public void setRequestFactory(OAuth2RequestFactory requestFactory) {
    this.requestFactory = requestFactory;
}
 
Example 14
Source Project: spring-cloud-shop   Source File: PhonePasswordTokenGranter.java    License: MIT License 4 votes vote down vote up
public PhonePasswordTokenGranter(AuthenticationManager authenticationManager,
                                 AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory) {
    this(authenticationManager, tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
}
 
Example 15
Source Project: spring-cloud-shop   Source File: PhonePasswordTokenGranter.java    License: MIT License 4 votes vote down vote up
protected PhonePasswordTokenGranter(AuthenticationManager authenticationManager, AuthorizationServerTokenServices tokenServices,
                                    ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, String grantType) {
    super(tokenServices, clientDetailsService, requestFactory, grantType);
    this.authenticationManager = authenticationManager;
}
 
Example 16
Source Project: OAuth-2.0-Cookbook   Source File: CustomAuthCodeTokenGranter.java    License: MIT License 4 votes vote down vote up
public CustomAuthCodeTokenGranter(AuthorizationServerTokenServices tokenServices,
                                     AuthorizationCodeServices authorizationCodeServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory) {
    this(tokenServices, authorizationCodeServices, clientDetailsService, requestFactory, GRANT_TYPE);
}
 
Example 17
Source Project: OAuth-2.0-Cookbook   Source File: CustomAuthCodeTokenGranter.java    License: MIT License 4 votes vote down vote up
protected CustomAuthCodeTokenGranter(AuthorizationServerTokenServices tokenServices, AuthorizationCodeServices authorizationCodeServices,
                                        ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, String grantType) {
    super(tokenServices, clientDetailsService, requestFactory, grantType);
    this.authorizationCodeServices = authorizationCodeServices;
}
 
Example 18
Source Project: osiam   Source File: OAuth2AuthorizationServerConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public OAuth2RequestFactory oAuth2RequestFactory() {
    return new DefaultOAuth2RequestFactory(osiamClientDetailsService);
}
 
Example 19
@Bean
public OAuth2RequestFactory oAuth2RequestFactory() {
    return new DefaultOAuth2RequestFactory(clientDetailsService);
}