BAEL-4019: movements for old code to accommodate new shiro application

This commit is contained in:
sampadawagde 2020-07-09 18:05:11 +05:30
parent 0d5a18622d
commit 990e0c1512
5 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,4 @@
package com.baeldung; package com.baeldung.intro;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationException;

View File

@ -1,4 +1,4 @@
package com.baeldung; package com.baeldung.intro;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;

View File

@ -1,4 +1,4 @@
package com.baeldung; package com.baeldung.intro;
import org.apache.shiro.realm.Realm; import org.apache.shiro.realm.Realm;
import org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition; import org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition;
@ -7,12 +7,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
/** /**
* Created by smatt on 21/08/2017. * Created by smatt on 21/08/2017.
*/ */
@SpringBootApplication @SpringBootApplication(exclude = SecurityAutoConfiguration.class)
public class ShiroSpringApplication { public class ShiroSpringApplication {
private static final transient Logger log = LoggerFactory.getLogger(ShiroSpringApplication.class); private static final transient Logger log = LoggerFactory.getLogger(ShiroSpringApplication.class);
@ -29,7 +30,7 @@ public class ShiroSpringApplication {
@Bean @Bean
public ShiroFilterChainDefinition shiroFilterChainDefinition() { public ShiroFilterChainDefinition filterChainDefinition() {
DefaultShiroFilterChainDefinition filter DefaultShiroFilterChainDefinition filter
= new DefaultShiroFilterChainDefinition(); = new DefaultShiroFilterChainDefinition();

View File

@ -1,6 +1,5 @@
package com.baeldung.controllers; package com.baeldung.intro.controllers;
import com.baeldung.models.UserCredentials;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authc.UsernamePasswordToken;
@ -13,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.baeldung.intro.models.UserCredentials;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@Controller @Controller

View File

@ -1,4 +1,4 @@
package com.baeldung.models; package com.baeldung.intro.models;
public class UserCredentials { public class UserCredentials {