Java Code Examples for org.apache.shiro.web.mgt.CookieRememberMeManager#setCipherKey()
The following examples show how to use
org.apache.shiro.web.mgt.CookieRememberMeManager#setCipherKey() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShiroAutoConfiguration.java From spring-boot-shiro with Apache License 2.0 | 6 votes |
@Bean @ConditionalOnMissingBean(RememberMeManager.class) public RememberMeManager rememberMeManager(Cookie cookie) { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(cookie); cookieRememberMeManager.setCipherService(cipherService); if (shiroCookieProperties.getCipherKey() != null) { cookieRememberMeManager.setCipherKey(shiroCookieProperties.getCipherKey().getBytes()); } else { if (shiroCookieProperties.getEncryptionCipherKey() != null) { cookieRememberMeManager.setEncryptionCipherKey(shiroCookieProperties.getEncryptionCipherKey().getBytes()); } if (shiroCookieProperties.getDecryptionCipherKey() != null) { cookieRememberMeManager.setDecryptionCipherKey(shiroCookieProperties.getDecryptionCipherKey().getBytes()); } } cookieRememberMeManager.setSerializer(serializer); return cookieRememberMeManager; }
Example 2
Source File: ShiroAutoConfiguration.java From utils with Apache License 2.0 | 6 votes |
@Bean @ConditionalOnMissingBean(RememberMeManager.class) public RememberMeManager rememberMeManager(Cookie cookie) { CookieRememberMeManager manager = new CookieRememberMeManager(); manager.setCookie(cookie); manager.setCipherService(cipherService); if (null != shiroCookieProperties.getCipherKey()) { manager.setCipherKey(shiroCookieProperties.getCipherKey().getBytes()); } else { if (null != shiroCookieProperties.getEncryptionCipherKey()) { manager.setEncryptionCipherKey(shiroCookieProperties.getEncryptionCipherKey().getBytes()); } if (null != shiroCookieProperties.getDecryptionCipherKey()) { manager.setDecryptionCipherKey(shiroCookieProperties.getDecryptionCipherKey().getBytes()); } } manager.setSerializer(serializer); return manager; }
Example 3
Source File: ShiroConfig.java From supplierShop with MIT License | 5 votes |
/** * 记住我 */ public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("fCq+/xW488hMTCD+cmJ3aQ==")); return cookieRememberMeManager; }
Example 4
Source File: ShiroConfig.java From EasyReport with Apache License 2.0 | 5 votes |
@Bean public CookieRememberMeManager rememberMeManager() { final CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCipherKey(Base64.decode("ZUdsaGJuSmxibVI2ZHc9PQ==")); cookieRememberMeManager.setCookie(rememberMeCookie()); return cookieRememberMeManager; }
Example 5
Source File: ShiroConfig.java From OneBlog with GNU General Public License v3.0 | 5 votes |
/** * cookie管理对象;记住我功能 * * @return */ public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); //rememberMe cookie加密的密钥 建议每个项目都不一样 默认AES算法 密钥长度(128 256 512 位) cookieRememberMeManager.setCipherKey(Base64.decode("1QWLxg+NYmxraMoxAXu/Iw==")); return cookieRememberMeManager; }
Example 6
Source File: ShiroConfig.java From LuckyFrameWeb with GNU Affero General Public License v3.0 | 5 votes |
/** * 记住我 */ public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("fCq+/xW488hMTCD+cmJ3aQ==")); return cookieRememberMeManager; }
Example 7
Source File: ShiroConfig.java From RuoYi with Apache License 2.0 | 5 votes |
/** * 记住我 */ private CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("fCq+/xW488hMTCD+cmJ3aQ==")); return cookieRememberMeManager; }
Example 8
Source File: ShiroConfig.java From ZTuoExchange_framework with MIT License | 5 votes |
/** * cookie 管理器 * @return */ @Bean(name="cookieRememberMeManager") @DependsOn({"simpleCookie"}) public CookieRememberMeManager getCookieRememberMeManager(SimpleCookie simpleCookie){ CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(simpleCookie); /** * 设置 rememberMe cookie 的密钥 ,不设置 很可能:javax.crypto.BadPaddingException: Given final block not properly padded */ cookieRememberMeManager.setCipherKey(Base64.decode("2AvVhdsgUs0FSA3SDFAdag==")); return cookieRememberMeManager ; }
Example 9
Source File: ShiroConfig.java From springboot-learn with MIT License | 5 votes |
/** * 记住我 */ public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("fCq+/xW488hMTCD+cmJ3aQ==")); return cookieRememberMeManager; }
Example 10
Source File: ShiroConfig.java From kvf-admin with MIT License | 5 votes |
/** * cookie管理对象; * @return cookieRememberMeManager */ private CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); // rememberMe cookie加密的密钥 建议每个项目都不一样 默认AES算法 密钥长度(128 256 512 位) cookieRememberMeManager.setCipherKey(Base64.decode("2AvVhdsgUs0FSA3SDFAdag==")); return cookieRememberMeManager; }
Example 11
Source File: ShiroConfig.java From WebStack-Guns with MIT License | 5 votes |
/** * rememberMe管理器, cipherKey生成见{@code Base64Test.java} */ @Bean public CookieRememberMeManager rememberMeManager(SimpleCookie rememberMeCookie) { CookieRememberMeManager manager = new CookieRememberMeManager(); manager.setCipherKey(Base64.decode("Z3VucwAAAAAAAAAAAAAAAA==")); manager.setCookie(rememberMeCookie); return manager; }
Example 12
Source File: ShiroConfig.java From ruoyiplus with MIT License | 5 votes |
/** * 记住我 */ public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("fCq+/xW488hMTCD+cmJ3aQ==")); return cookieRememberMeManager; }
Example 13
Source File: ShiroConfig.java From pybbs with GNU Affero General Public License v3.0 | 5 votes |
@Bean @DependsOn("mybatisPlusConfig") public CookieRememberMeManager rememberMeManager() { //System.out.println("ShiroConfiguration.rememberMeManager()"); CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); //rememberMe cookie加密的密钥 建议每个项目都不一样 默认AES算法 密钥长度(128 256 512 位) cookieRememberMeManager.setCipherKey(Base64.encode("pybbs is the best!".getBytes())); return cookieRememberMeManager; }
Example 14
Source File: ShiroConfig.java From ZTuoExchange_framework with MIT License | 5 votes |
/** * cookie 管理器 * @return */ @Bean(name="cookieRememberMeManager") @DependsOn({"simpleCookie"}) public CookieRememberMeManager getCookieRememberMeManager(SimpleCookie simpleCookie){ CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(simpleCookie); /** * 设置 rememberMe cookie 的密钥 ,不设置 很可能:javax.crypto.BadPaddingException: Given final block not properly padded */ cookieRememberMeManager.setCipherKey(Base64.decode("2AvVhdsgUs0FSA3SDFAdag==")); return cookieRememberMeManager ; }
Example 15
Source File: ShiroConfig.java From yyblog with MIT License | 5 votes |
/** * cookie管理器; * @return */ @Bean public CookieRememberMeManager rememberMeManager(){ CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); //rememberme cookie加密的密钥 建议每个项目都不一样 默认AES算法 密钥长度(128 256 512 位),通过以下代码可以获取 //KeyGenerator keygen = KeyGenerator.getInstance("AES"); //SecretKey deskey = keygen.generateKey(); //System.out.println(Base64.encodeToString(deskey.getEncoded())); byte[] cipherKey = Base64.decode("wGiHplamyXlVB11UXWol8g=="); cookieRememberMeManager.setCipherKey(cipherKey); cookieRememberMeManager.setCookie(rememberMeCookie()); return cookieRememberMeManager; }
Example 16
Source File: ShiroConfiguration.java From White-Jotter with MIT License | 4 votes |
public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey("EVANNIGHTLY_WAOU".getBytes()); return cookieRememberMeManager; }
Example 17
Source File: ShiroConfig.java From SpringAll with MIT License | 4 votes |
public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("4AvVhmFLUs0KTA3Kprsdag==")); return cookieRememberMeManager; }
Example 18
Source File: ShiroConfig.java From SpringAll with MIT License | 4 votes |
public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("4AvVhmFLUs0KTA3Kprsdag==")); return cookieRememberMeManager; }
Example 19
Source File: ShiroConfig.java From SpringAll with MIT License | 4 votes |
public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("4AvVhmFLUs0KTA3Kprsdag==")); return cookieRememberMeManager; }
Example 20
Source File: ShiroConfig.java From SpringAll with MIT License | 4 votes |
public CookieRememberMeManager rememberMeManager() { CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); cookieRememberMeManager.setCookie(rememberMeCookie()); cookieRememberMeManager.setCipherKey(Base64.decode("4AvVhmFLUs0KTA3Kprsdag==")); return cookieRememberMeManager; }