private TokenGranter tokenGranter(HttpSecurity http) throws Exception {
if(tokenGranter == null) {
ClientDetailsService clientDetails = clientDetails();
AuthorizationServerTokenServices tokenServices = tokenServices(http);
AuthorizationCodeServices authorizationCodeServices = authorizationCodeServices(http);
AuthenticationManager authenticationManager = authenticationManager(http);
List<TokenGranter> tokenGranters = new ArrayList<TokenGranter>();
tokenGranters.add(new AuthorizationCodeTokenGranter(tokenServices,
authorizationCodeServices, clientDetails));
tokenGranters