Quantcast

Extending SubjectContext

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Extending SubjectContext

Bubba
I would like to extend WebSubjectContext in order to inject my own application specific information into the subject. However, I don't see a trivial way to do this. It appears that I would need to extend WebSubjectContext, then extend WebSubject, and WebSecurityManager (perhaps others) in order to make them all aware of the new SubjectContext. I'm hopeful that I'm missing something simple in the configuration that would allow me to simply extend the SubjectContext and make the rest of Shiro aware of the modification. I believe it's possible to affect the same sort of thing by sticking this information in a session for the subject and then getting it from there as needed. But then what would be the point of having a SubjectContext? Thanks in advance!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Extending SubjectContext

jleleu
Hi Bubba,

If you want to create a Subject with your own specific application information, I would recommend to create your own Subject implementation and a specific SubjectFactory to create this kind of subject, as you can easily set this SubjectFactory to the security manager using the setSubjectFactory setter.
Best regards,
Jérôme



2012/4/3 Bubba [via Shiro Developer] <[hidden email]>
I would like to extend WebSubjectContext in order to inject my own application specific information into the subject. However, I don't see a trivial way to do this. It appears that I would need to extend WebSubjectContext, then extend WebSubject, and WebSecurityManager (perhaps others) in order to make them all aware of the new SubjectContext. I'm hopeful that I'm missing something simple in the configuration that would allow me to simply extend the SubjectContext and make the rest of Shiro aware of the modification. I believe it's possible to affect the same sort of thing by sticking this information in a session for the subject and then getting it from there as needed. But then what would be the point of having a SubjectContext? Thanks in advance!


If you reply to this email, your message will be added to the discussion below:
http://shiro-developer.582600.n2.nabble.com/Extending-SubjectContext-tp7433356p7433356.html
To start a new topic under Shiro Developer, email [hidden email]
To unsubscribe from Shiro Developer, click here.
NAML

Loading...