package io.github.endron.oauth.authserver;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;

@SpringBootApplication
@EnableAuthorizationServer
public class Application extends AuthorizationServerConfigurerAdapter {

    public static void main(final String... args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    public void configure(final ClientDetailsServiceConfigurer clients) throws Exception {
        clients.inMemory()
                .withClient("testClient")
                .secret("secret");
    }
}

@@ -149,32 +149,276 @@
 ootApplication;%0A
+import org.springframework.context.annotation.Configuration;%0Aimport org.springframework.security.config.annotation.web.builders.HttpSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;%0A
 import org.sprin
@@ -728,16 +728,82 @@
 nServer;
+%0Aimport org.springframework.web.bind.annotation.SessionAttributes;
 %0A%0A@Sprin
@@ -846,16 +846,59 @@
 nServer%0A
+@SessionAttributes(%22authorizationRequest%22)%0A
 public c
@@ -990,22 +990,16 @@
 id main(
-final 
 String..
@@ -1115,14 +1115,8 @@
 ure(
-final 
 Clie
@@ -1260,25 +1260,552 @@
    .
-secret(%22secret%22);
+authorizedGrantTypes(%22authorization_code%22, %22refresh_token%22).scopes(%22openid%22)%0A                .authorities(%22ROLE_OAUTH_CLIENT%22);%0A    %7D%0A%0A    @Configuration%0A    public static class WebSecurityConfig extends WebSecurityConfigurerAdapter %7B%0A%0A        @Override%0A        protected void configure(HttpSecurity http) throws Exception %7B%0A            http%0A                    .formLogin()%0A                        .permitAll()%0A                    .and()%0A                    .authorizeRequests()%0A                        .anyRequest().authenticated();%0A        %7D
 %0A   

correct errors with the configuration