@@ -0,0 +1,2612 @@
+package com.rizki.mufrizal.belajar.oauth2.configSecurity;%0A%0Aimport com.rizki.mufrizal.belajar.oauth2.service.UserDetailLoginService;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.security.authentication.AuthenticationManager;%0Aimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;%0Aimport org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;%0Aimport org.springframework.security.config.annotation.web.builders.HttpSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;%0Aimport org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;%0Aimport org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;%0Aimport org.springframework.security.crypto.password.PasswordEncoder;%0A%0A@Configuration%0A@EnableWebSecurity(debug = true)%0A@EnableWebMvcSecurity%0A@EnableGlobalMethodSecurity(securedEnabled = true)%0Apublic class WebSecurityConfig extends WebSecurityConfigurerAdapter%7B%0A%0A    @Autowired%0A    private UserDetailLoginService userDetailLoginService;%0A%0A    @Bean%0A    public PasswordEncoder passwordEncoder() %7B%0A        return new BCryptPasswordEncoder();%0A    %7D%0A%0A    @Autowired%0A    public void configureGlobal(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception%7B%0A        authenticationManagerBuilder%0A                .inMemoryAuthentication()%0A                .and()%0A                    .userDetailsService(userDetailLoginService)%0A                    .passwordEncoder(passwordEncoder());%0A    %7D%0A%0A    @Bean%0A    @Override%0A    public AuthenticationManager authenticationManagerBean() throws Exception%7B%0A        return super.authenticationManagerBean();%0A    %7D%0A%0A    @Override%0A    public void configure(HttpSecurity httpSecurity) throws Exception%7B%0A        httpSecurity%0A                .authorizeRequests()%0A                    .antMatchers(%22/login%22).permitAll()%0A                .and()%0A                    .formLogin()%0A                        .loginPage(%22/login%22)%0A                        .loginProcessingUrl(%22/j_spring_security_check%22)%0A                        .usernameParameter(%22j_username%22)%0A                        .passwordParameter(%22j_password%22)%0A                .and()%0A                    .logout()%0A                        .logoutUrl(%22/j_spring_security_logout%22);%0A    %7D%0A%0A%7D%0A

Add Web Security Config