Polish sample package names
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package sample.ui.method;
|
||||
package sample.security.method;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
@@ -58,10 +58,6 @@ public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter {
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SpringApplicationBuilder(SampleMethodSecurityApplication.class).run(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/login").setViewName("login");
|
||||
@@ -73,6 +69,10 @@ public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter {
|
||||
return new ApplicationSecurity();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SpringApplicationBuilder(SampleMethodSecurityApplication.class).run(args);
|
||||
}
|
||||
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||
@Configuration
|
||||
protected static class AuthenticationSecurity extends
|
||||
@@ -80,12 +80,11 @@ public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void init(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth.inMemoryAuthentication().withUser("admin").password("admin")
|
||||
.roles("ADMIN", "USER").and().withUser("user").password("user")
|
||||
.roles("USER");
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
|
||||
@@ -93,13 +92,11 @@ public class SampleMethodSecurityApplication extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
// @formatter:off
|
||||
http.authorizeRequests().antMatchers("/login").permitAll().anyRequest()
|
||||
.fullyAuthenticated().and().formLogin().loginPage("/login")
|
||||
.failureUrl("/login?error").and().logout()
|
||||
.logoutRequestMatcher(new AntPathRequestMatcher("/logout")).and()
|
||||
.exceptionHandling().accessDeniedPage("/access?error");
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user