Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
f68555e6
Commit
f68555e6
authored
Jan 04, 2019
by
ms-dev
Browse files
shiro配置
parent
49d2a620
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/config/ShiroConfig.java
View file @
f68555e6
...
...
@@ -14,12 +14,21 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
;
import
com.mingsoft.basic.configurer.ShiroTagFreeMarkderConfigurer
;
import
net.mingsoft.basic.security.BaseAuthRealm
;
@Configuration
public
class
ShiroConfig
{
@Value
(
"managerPath"
)
private
String
managerPath
;
@Bean
public
ShiroTagFreeMarkderConfigurer
freemarkerConfig
()
{
return
new
ShiroTagFreeMarkderConfigurer
();
}
@Bean
public
ShiroFilterFactoryBean
shirFilter
(
SecurityManager
securityManager
)
{
...
...
@@ -63,17 +72,17 @@ public class ShiroConfig {
return
hashedCredentialsMatcher
;
}
//
@Bean
//
public BaseAuthRealm myShiroRealm() {
//
BaseAuthRealm myShiroRealm = new BaseAuthRealm();
//
myShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher());
//
return myShiroRealm;
//
}
@Bean
public
BaseAuthRealm
myShiroRealm
()
{
BaseAuthRealm
myShiroRealm
=
new
BaseAuthRealm
();
myShiroRealm
.
setCredentialsMatcher
(
hashedCredentialsMatcher
());
return
myShiroRealm
;
}
@Bean
public
SecurityManager
securityManager
()
{
DefaultWebSecurityManager
securityManager
=
new
DefaultWebSecurityManager
();
//
securityManager.setRealm(myShiroRealm());
securityManager
.
setRealm
(
myShiroRealm
());
return
securityManager
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment