@@ -0,0 +1,2236 @@
+package com.aemreunal.config;%0A%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;%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;%0A%0A/*%0A ***************************%0A * Copyright (c) 2014      *%0A *                         *%0A * This code belongs to:   *%0A *                         *%0A * @author Ahmet Emre %C3%9Cnal *%0A * S001974                 *%0A *                         *%0A * aemreunal@gmail.com     *%0A * emre.unal@ozu.edu.tr    *%0A *                         *%0A * aemreunal.com           *%0A ***************************%0A */%0A%0A/*%0A * Via: https://spring.io/guides/tutorials/rest/5/%0A */%0A%0A@Configuration%0A@EnableWebSecurity%0Apublic class SecurityConfig extends WebSecurityConfigurerAdapter %7B%0A%0A//    @Override%0A//    protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception %7B%0A//        auth.inMemoryAuthentication()%0A//            .withUser(%22letsnosh%22).password(%22noshing%22).roles(%22USER%22);%0A//    %7D%0A//%0A//    @Override%0A//    protected void configure(HttpSecurity http) throws Exception %7B%0A//        http.authorizeUrls()%0A//            .antMatchers(%22/aggregators/**%22).hasRole(%22USER%22)%0A//            .anyRequest().anonymous()%0A//            .and()%0A//            .httpBasic();%0A//    %7D%0A%0A    @Override%0A    protected void configure(HttpSecurity http) throws Exception %7B%0A        http.authorizeRequests()%0A            .antMatchers(%22/**%22).hasRole(%22USER%22)%0A            .anyRequest().anonymous()%0A            .and()%0A            .httpBasic();%0A//            .and()%0A//            .formLogin()%0A        ;%0A    %7D%0A%0A    @Override%0A    protected void configure(AuthenticationManagerBuilder auth) throws Exception %7B%0A        auth.inMemoryAuthentication()%0A            .withUser(%22user%22)%0A            .password(%22password%22)%0A            .roles(%22USER%22)%0A            .and()%0A            .withUser(%22adminr%22)%0A            .password(%22password%22)%0A            .roles(%22ADMIN%22, %22USER%22);%0A//        auth.jdbcAuthentication().%0A    %7D%0A%7D%0A

Add basic Spring Security configuration