Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting a session problem. #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Correcting a session problem. #6

wants to merge 3 commits into from

Conversation

Bakrog
Copy link

@Bakrog Bakrog commented Aug 28, 2014

Correcting a problem when sometimes you can get a new session in your controller.

@Turini
Copy link
Collaborator

Turini commented Aug 29, 2014

@Bakrog, thanks for doing it :)
@linyatis when/if possible, can you test the solution?

@linyatis
Copy link

@Bakrog and @Turini, I'll try this tonight!

@linyatis
Copy link

@Turini, It does not work with annotation, just programmatically =(
@Bakrog, you did exactly the same thing as I did.
The session and subject now work together, but not at Shiro's context. Somehow is not the same instance that Shiro uses.

@Bakrog
Copy link
Author

Bakrog commented Aug 30, 2014

@linyatis, Oh, I didn't try using annotations. I'll look at this tonight.

@Bakrog
Copy link
Author

Bakrog commented Sep 6, 2014

@Turini, Can I add a provided dependency to servlet-api 3.0.1?

@Turini
Copy link
Collaborator

Turini commented Sep 6, 2014

hum, did you mean javax-servlet-api? VRaptor's core uses the
3.1.0 version, we really need the 3.0.1? (it will help somehow here?)

#4.
Now the "interceptors" tag in beans.xml need to be declared in your
dynamic web project.
@Bakrog
Copy link
Author

Bakrog commented Sep 7, 2014

@Turini never mind! I changed to javax.ejb-api and I could correct issue #4.
@linyatis, @mtnoronha, when/if possible, can you test the solution?
P.S: You can't use SecurityUtils.getSubject(). I'm trying to figure out how build the subject and associate it with the current thread.

@linyatis
Copy link

@Bakrog, I can't test it now, but let me understand. You fixed issue #4 by now? Do you fixed the issue of the session using it programmatically and with annotations? What do you need that I test?

By the way, @Turini, we never opened an issue about this (session), right?
Would be interesting open it or not?

@Bakrog
Copy link
Author

Bakrog commented Oct 25, 2014

@linyatis, yes, I correct issue #4 by adding the annotation Startup (javax.ejb-api) in the class SecurityFacade.
Now you can use apache shiro annotations or do it programmatically. But you need to inject the subject and cant use SecurityUtils.getSubject() because there is another thread for shiro and the subject isnt build in that thread. And you need to declare the interceptor in your dynamic web project.
Can you test if the annotation problem is solved in your project?

@Bakrog
Copy link
Author

Bakrog commented Oct 25, 2014

Oh, you only need to inject the subject if you're doing it programmatically.

@Turini
Copy link
Collaborator

Turini commented Oct 25, 2014

we never opened an issue about this (session), right?

Not sure, but I think we ddidn't.

Would be interesting open it or not?

Yes, it would be nice.

@linyatis
Copy link

Hey guys! Sorry for the delay in responding, I had forgotten!
@Bakrog, I tested here and looks like issue #4 is corrected now.

@Turini, later I will open that issue about annotations not working with Wildfly. I will test with others containers.

@Bakrog
Copy link
Author

Bakrog commented Nov 18, 2014

@linyatis @Turini I think issue #5 is about the annotations problem.
@linyatis Did the annotations not work with this pull request? Did you declare the interceptor (br.com.caelum.vraptor.security.interceptor.SecurityInterceptor) in your project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants