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

The following examples show how to use org.springframework.security.oauth2.provider.OAuth2RequestFactory. 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: LessStrictRedirectUriAuthorizationCodeTokenGranter.java    From osiam with MIT License 5 votes vote down vote up
public LessStrictRedirectUriAuthorizationCodeTokenGranter(
        AuthorizationServerTokenServices tokenServices,
        AuthorizationCodeServices authorizationCodeServices,
        ClientDetailsService clientDetailsService,
        OAuth2RequestFactory requestFactory
) {
    super(tokenServices, clientDetailsService, requestFactory, GRANT_TYPE);
    this.authorizationCodeServices = authorizationCodeServices;
}
 
Example #2
Source File: OAuth2Config.java    From spring-cloud-gray with 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 File: OAuth2SecurityConfiguration.java    From spring-cloud-shop with 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
Source File: CustomResourceOwnerPasswordTokenGranter.java    From spring-auth-example with MIT License 5 votes vote down vote up
protected CustomResourceOwnerPasswordTokenGranter(
    AuthenticationManager authenticationManager,
    AuthorizationServerTokenServices tokenServices,
    ClientDetailsService clientDetailsService,
    OAuth2RequestFactory requestFactory, String grantType) {
  super(tokenServices, clientDetailsService, requestFactory, grantType);
  this.authenticationManager = authenticationManager;
}
 
Example #5
Source File: CustomResourceOwnerPasswordTokenGranter.java    From spring-auth-example with MIT License 5 votes vote down vote up
public CustomResourceOwnerPasswordTokenGranter(
    AuthenticationManager authenticationManager,
    AuthorizationServerTokenServices tokenServices,
    ClientDetailsService clientDetailsService,
    OAuth2RequestFactory requestFactory) {
  this(authenticationManager, tokenServices, clientDetailsService,
      requestFactory, GRANT_TYPE);
}
 
Example #6
Source File: FebsAuthorizationServerConfigure.java    From FEBS-Cloud with Apache License 2.0 5 votes vote down vote up
@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 #7
Source File: SmsTokenGranter.java    From spring-cloud-shop with MIT License 4 votes vote down vote up
public void setRequestFactory(OAuth2RequestFactory requestFactory) {
    this.requestFactory = requestFactory;
}
 
Example #8
Source File: OAuth2ServerConfiguration.java    From spring-oauth-server with GNU General Public License v2.0 4 votes vote down vote up
@Bean
public OAuth2RequestFactory oAuth2RequestFactory() {
    return new DefaultOAuth2RequestFactory(clientDetailsService);
}
 
Example #9
Source File: OAuth2AuthorizationServerConfig.java    From osiam with MIT License 4 votes vote down vote up
@Bean
public OAuth2RequestFactory oAuth2RequestFactory() {
    return new DefaultOAuth2RequestFactory(osiamClientDetailsService);
}
 
Example #10
Source File: CustomAuthCodeTokenGranter.java    From OAuth-2.0-Cookbook with 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 #11
Source File: CustomAuthCodeTokenGranter.java    From OAuth-2.0-Cookbook with 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 #12
Source File: PhonePasswordTokenGranter.java    From spring-cloud-shop with 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 #13
Source File: PhonePasswordTokenGranter.java    From spring-cloud-shop with 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 #14
Source File: SmsTokenGranter.java    From spring-cloud-shop with MIT License 4 votes vote down vote up
@Override
public OAuth2RequestFactory getRequestFactory() {
    return requestFactory;
}
 
Example #15
Source File: SmsTokenGranter.java    From spring-cloud-shop with 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 #16
Source File: SmsTokenGranter.java    From spring-cloud-shop with 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 #17
Source File: OAuth2Config.java    From spring-cloud-gray with 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 #18
Source File: OAuth2Config.java    From spring-cloud-gray with 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 #19
Source File: OAuth2Config.java    From spring-cloud-gray with Apache License 2.0 4 votes vote down vote up
@Bean
public OAuth2RequestFactory requestFactory(ClientDetailsService clientDetailsService) {
    return new DefaultOAuth2RequestFactory(clientDetailsService);
}