shiro

JerseyTest with shiro

≡放荡痞女 提交于 2019-12-11 05:56:25
问题 Instantiating JerseyTest with this class public class NMAAbstractRestTest extends JerseyTest { @Override protected Application configure() { NMAdaptorApplication application = new NMAdaptorApplication(); return application; } } NMAdaptorApplication constructor. public NMAdaptorApplication() { log.info("NM-Adaptor-Application is being initilized...."); register(NMRestExceptionMapper.class); register(ShiroFeature.class); register(NMMarshallingFeature.class); register(new LoggingFeature(java

Is Shiro Native Session Management Compatible With JSF SessionScoped CDI Beans

南笙酒味 提交于 2019-12-11 05:04:03
问题 Am having a problem with Shiro native session management and JSF CDI SessionScoped beans. Am using Shiro 1.4.0 and Payara 4.1.1.171 (build 137). This is kind of a complicated interaction, so I have created a very simple scenario to demonstrate the problem (see code below). Here is what is happening: When I use Shiro's default (non-native) session management, I can log in to the test application and press the "Say Something New" button (which is using AJAX) and my screen will be properly

how to show session is about to timeout dialog before 1 min in jsp?

自作多情 提交于 2019-12-11 04:00:45
问题 I am trying to show session is about to timeout dialog in my shiro based application here is my code what i tried but its not working yet... <% Subject user = SecurityUtils.getSubject(); Session usersession = user.getSession(true); if(user.isAuthenticated()){ Date startTime = usersession.getStartTimestamp(); //login time Date lastAccessTime = usersession.getLastAccessTime(); //last active time Date currentTime = new Date(); // current time long diffInSec = (currentTime.getTime()-

Jetty maven plugin unable to hot redeploy shiro filter

前提是你 提交于 2019-12-11 03:36:48
问题 I'm not sure if this is a jetty issue or an issue with shiro, but I am trying to use the Jetty-Maven plugin for development and one of the key features I want is Jetty's hot redeployment when files are changed. However, Shiro is throwing the following exception when jetty attempts to reload the application and I am not certain what can be done to correct this. [Scanner-0] ERROR org.apache.shiro.web.servlet.AbstractFilter - Unable to start Filter: [No WebEnvironment found: no

吃透Shiro源码第四天

情到浓时终转凉″ 提交于 2019-12-11 03:22:54
文章目录 技术手法 (1)究竟什么是缓存 (2)用Map作为缓存实现 (3)如何管理缓存生命周期 (4)AOP解析方法上的注解思路 重点研究类 技术手法 (1)究竟什么是缓存 缓存这个词语,我耳朵都快听出茧子了,什么Redis、Ecache。不过,到底什么是缓存,说实在的,我一直很模糊其概念。今天终于接近了缓存代码的源头。缓存到底是什么?我的总结:缓存对象是一个可以封装多组键值对的特殊对象。因此,缓存可以视为一种容器。 如下代码展示了缓存最顶层的接口。原来缓存一点都不神秘,它就是一种可以用来增删对象的容器。 public interface Cache < K , V > . . . /** * 存 * * @param key key * @param value value */ void put ( K key , V value ) throws CacheException ; /** * 取 * * @param key key * @return value */ V get ( K key ) throws CacheException ; /** * 删 * * @param k key * @return value */ V remove ( K k ) throws CacheException ; (2)用Map作为缓存实现 既然缓存是容器

Spring AOP and apache shiro configuration.Annotations not been scanned

喜夏-厌秋 提交于 2019-12-11 03:13:22
问题 I've been struggling with a configuration which requires a knowledge in AOP. i must admit that AOP is that part i'm trying to get for a while without success. It seems that my shiro annotations are not scanned and thus are ignored. i've tried using shiro 1.1.0+ maven3+spring 3.0.5.RELEASE, hibernate 3.6.1.Final with ZK 5.0.6. i got my hibernaterealm working , talking to database, i got the authentication working, i successfully(i believe) get the roles and permission loaded. so to test the

spring整合shiro使用redis session共享 .NoSuchBeanDefinitionException

怎甘沉沦 提交于 2019-12-10 20:44:48
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring/spring.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [spring/spring.xml]: Cannot resolve reference to bean 'cacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException:

How to safely change the session cookie DOMAIN or name in production?

≡放荡痞女 提交于 2019-12-10 20:07:37
问题 We recently realized that our session cookie is being written out to the fully qualified domain name of our site, www.myapp.com , for example: MYAPPCOOKIE: 79D5DB83..., domain: www.myapp.com We want to switch this to being a cookie that can be shared cross subdomain, so any server at myapp.com can use the session cookie as well. For example, we'd like our cookie to store like so: MYAPPCOOKIE: 79D5DB83..., domain: .myapp.com We tried just changing our session cookie to use that domain like so:

Shiro always redirects me to login.jsp

╄→尐↘猪︶ㄣ 提交于 2019-12-10 17:55:02
问题 Here is the config from shiro.ini shiro.loginUrl = /login.jsp ######### URL CONFIG ################### [urls] /login.jsp = anon /public/login/** = anon /public/app/** = authc Stripes ... @UrlBinding("/public/app/") public class CalculatorActionBean implements ActionBean { ..... } @UrlBinding("/public/login/") public class UserAuthenticateBean implements ActionBean { private static final transient Logger log = LoggerFactory.getLogger(UserAuthenticateBean.class); private ActionBeanContext