in resolver, how to use email attribute from ldap for dataconnector URLTemplate

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

in resolver, how to use email attribute from ldap for dataconnector URLTemplate

Pablo Vidaurri
I'm pulling email attributes from an ldap connector and have the attributeDefinition as follows:
<AttributeDefinition id="myMail" xsi:type="Simple">
        <InputDataConnector ref="myLDAP" attributeNames="email"/>
        <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:mail" encodeType="false" />
        <AttributeEncoder xsi:type="SAML2String" name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="myMail" encodeType="false" />
    </AttributeDefinition>

I'm now trying to use that attribute as a query param into a URLTemplate:
<DataConnector id="myRestWebSvc" xsi:type="HTTP" httpClientRef="shibboleth.NonCachingHttpClient">
        <URLTemplate>
            <![CDATA[
                http://localhost:8080/rest/v3/getUserInfo?emailId=$paramEscaper.escape($myMail)
            ]]>
        </URLTemplate>
.
.
.
I'm getting a null pointer exception from paramEscaper.
I've also tried:
$myMail.getValues().get(0)
$myMail.get(0)
$myMail.getValue()
all options I've ran into from the docs.

Anyone able to get something like this to work?

Thanks.
-psv

--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: in resolver, how to use email attribute from ldap for dataconnector URLTemplate

Rod Widdowson
.

Anyone able to get something like this to work?

I’m not at my desk, but I’m reasonably certain that you cannot in v3.  In V4 you would  use a preRequested attribute [1]


--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: in resolver, how to use email attribute from ldap for dataconnector URLTemplate

Cantor, Scott E.
In reply to this post by Pablo Vidaurri
The syntax is $attributeName.get(0) for the first value.

-- Scott


--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: in resolver, how to use email attribute from ldap for dataconnector URLTemplate

Peter Schober
In reply to this post by Pablo Vidaurri
* Pablo Vidaurri <[hidden email]> [2019-11-23 06:38]:
> I'm now trying to use that attribute as a query param into a URLTemplate:
>
> <DataConnector id="myRestWebSvc" xsi:type="HTTP" httpClientRef="shibboleth.NonCachingHttpClient">
>   <URLTemplate>
>     <![CDATA[
>       http://localhost:8080/rest/v3/getUserInfo?emailId=$paramEscaper.escape($myMail)
>     ]]>
>   </URLTemplate>

Just noting that your DataConnector has neither an
  <InputAttributeDefinition ref="myMail" />
nor an
  <InputDataConnector ref="myLDAP" attributeNames="email"/>
  (in which case it would have to reference $email, not $myMail)
dependency declared.

-peter
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: in resolver, how to use email attribute from ldap for dataconnector URLTemplate

Pablo Vidaurri
Perfect! Adding   
<InputDataConnector ref="myLDAP" attributeNames="email"/> 
to my DataConnector I was able to reference $email.get(0) in my URLTemplate.

On Mon, Nov 25, 2019 at 7:19 AM Peter Schober <[hidden email]> wrote:
* Pablo Vidaurri <[hidden email]> [2019-11-23 06:38]:
> I'm now trying to use that attribute as a query param into a URLTemplate:
>
> <DataConnector id="myRestWebSvc" xsi:type="HTTP" httpClientRef="shibboleth.NonCachingHttpClient">
>   <URLTemplate>
>     <![CDATA[
>       http://localhost:8080/rest/v3/getUserInfo?emailId=$paramEscaper.escape($myMail)
>     ]]>
>   </URLTemplate>

Just noting that your DataConnector has neither an
  <InputAttributeDefinition ref="myMail" />
nor an
  <InputDataConnector ref="myLDAP" attributeNames="email"/>
  (in which case it would have to reference $email, not $myMail)
dependency declared.

-peter
--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]

--
For Consortium Member technical support, see https://wiki.shibboleth.net/confluence/x/coFAAg
To unsubscribe from this list send an email to [hidden email]