| | |
| | | map.put("/api-docs", "anon"); |
| | | map.put("/v3/**", "anon"); |
| | | |
| | | |
| | | map.put("/link-basic/*", "anon"); |
| | | map.put("/user/login/**","anon");//表示这个为公共资源 一定是在受限资源上面 |
| | | // map.put("/**","jwtFilter");//表示这个资源需要认证和授权 |
| | | |
| | |
| | | return securityManager; |
| | | } |
| | | |
| | | // 创建自定义Realm |
| | | // 创建自定义Realm |
| | | @Bean |
| | | public Realm shiroRealm() { |
| | | return new ShiroRealm(); |
| | | ShiroRealm realm = new ShiroRealm(); |
| | | // HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(); |
| | | //// //设置使用MD5加密算法 |
| | | //// credentialsMatcher.setHashAlgorithmName(Md5Hash.ALGORITHM_NAME); |
| | | //// //散列次数 |
| | | //// credentialsMatcher.setHashIterations(1024); |
| | | // realm.setCredentialsMatcher(credentialsMatcher); |
| | | return realm; |
| | | } |
| | | |
| | | @Bean |
| | | public Realm JwtRealm(){ |
| | | return new JwtRealm(); |
| | | JwtRealm jwtRealm = new JwtRealm(); |
| | | // 设置加密算法 |
| | | CredentialsMatcher credentialsMatcher = new JwtCredentialsMatcher(); |
| | | // 设置加密次数 |
| | | jwtRealm.setCredentialsMatcher(credentialsMatcher); |
| | | return jwtRealm; |
| | | } |
| | | |
| | | |