getRelayState for scripted attribute definition

Brent Putman putmanb at georgetown.edu
Thu Apr 2 12:36:26 EDT 2015



On 4/2/15 12:13 PM, Abromowitz, Samuel wrote:
>
> Looking at the wiki
> https://wiki.shibboleth.net/confluence/display/IDP30/ScriptedAttributeDefinition
> I see that the requestContext has changed. With IDP V2 I was able to
> get the relay state by calling requestContext.getRelayState() from
> the attribute resolver. Is there a way to do this with IDP V3?
>

Yes.  Literally everything the IdP is processing is visible via the
ProfileRequestContext, which is the root of a tree of contexts.  As
that page documents, it's exposed via the ' profileContext' variable.

The Java for this would be:

profileContext.getInboundMessageContext().getSubcontext(SAMLBindingContext.class).getRelayState();

where SAMLBindingContext full class is =
org.opensaml.saml.common.messaging.context.SAMLBindingContext


The general way to access subcontexts in the tree from a resolver
script is also documented there in the wiki.  I can't test off-hand,
but I think the scripted variant for your question should be something
like the following:

clazloader = resolutionContext.getClass().getClassLoader();

bindingContextClass =
clazloader.loadClass("org.opensaml.saml.common.messaging.context.SAMLBindingContext");

relayState =
resolutionContext.getInboundMessageContext().getSubcontext(bindingContextClass).getRelayState();
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20150402/3cb72163/attachment.html 


More information about the users mailing list