Accessing CAS attributes from custom Shib 3 data connector
Cantor, Scott
cantor.2 at osu.edu
Tue Aug 25 09:35:17 EDT 2015
On 8/25/15, 2:03 AM, "dev on behalf of John Manaloto" <dev-bounces at shibboleth.net on behalf of manalotoj at gmail.com> wrote:
>
>How do I access either the userSession or the HttpServletRequest from my custom data connector (extends AbstractDataConnector)?
Both are frowned on because that makes use of the connector impossible over the back channel. We don't have a clean model for distinguishing the use of the resolver in the two cases, so we favor designs that do not depend on that distinction.
On the front channel, the user session is available (if at all) from a SessionContext child, but the data that matters is the Java Subject, which is in a SubjectContext.
There is no direct access to the servlet layer. There are other use cases for accessing it, so I would suggest filing a RFE to have it added to the scripting context, but for a custom connector, you have a couple of options.
You could actually have Spring inject it as a property, and have your custom parser inject a bean reference to shibboleth.HttpServletRequest.
Or you can access it by way of Spring Web Flow by accessing a subcontext of the PRC called SpringContext. It contains the SWF RequestContext (yes, the names get really confusing). That carries methods that will get you to what they call the NativeRequest, which is the HttpServletRequest.
-- Scott
More information about the dev
mailing list