List of usage examples for org.springframework.security.oauth2.provider CompositeTokenGranter CompositeTokenGranter
public CompositeTokenGranter(List<TokenGranter> tokenGranters)
From source file:org.osiam.configuration.OAuth2AuthorizationServerConfig.java
@Bean public TokenGranter tokenGranter() throws Exception { return new CompositeTokenGranter(Arrays.asList(new TokenGranter[] { new ClientCredentialsTokenGranter(tokenServices(), osiamClientDetailsService, oAuth2RequestFactory()), new OsiamResourceOwnerPasswordTokenGranter(authenticationManager, tokenServices(), osiamClientDetailsService, oAuth2RequestFactory()), new RefreshTokenGranter(tokenServices(), osiamClientDetailsService, oAuth2RequestFactory()), new LessStrictRedirectUriAuthorizationCodeTokenGranter(tokenServices(), authorizationCodeServices(), osiamClientDetailsService, oAuth2RequestFactory()) })); }
From source file:org.joyrest.oauth2.initializer.OAuth2Initializer.java
private TokenGranter compositeTokenGranter(final ClientDetailsService clientService, final AuthenticationManager manager, final DefaultTokenServices tokenServices, final OAuth2RequestFactory requestFactory, final AuthorizationCodeServices authorizationCodeServices) { List<TokenGranter> granters = new ArrayList<>(); granters.add(new ClientCredentialsTokenGranter(tokenServices, clientService, requestFactory)); granters.add(new ImplicitTokenGranter(tokenServices, clientService, requestFactory)); granters.add(new ResourceOwnerPasswordTokenGranter(manager, tokenServices, clientService, requestFactory)); granters.add(new RefreshTokenGranter(tokenServices, clientService, requestFactory)); granters.add(new AuthorizationCodeTokenGranter(tokenServices, authorizationCodeServices, clientService, requestFactory));//from w ww .j a v a 2 s . com return new CompositeTokenGranter(granters); }