Dependency and RDBMS QueryTemplate
Tom Poage
tfpoage at ucdavis.edu
Thu Jan 18 23:07:46 EST 2018
Evening,
IdP 3.3.x
Resolver:
<DataConnector xsi:type="RelationalDatabase"
id="aConnector"
activationConditionRef="aCondition">
<BeanManagedConnection>aDataSource</BeanManagedConnection>
<QueryTemplate>
<![CDATA[
SELECT TRACK_2
FROM SCHEMA.TABLE
WHERE IDXCOL1 = $queryAttribute.get(0)
]]>
</QueryTemplate>
<Column columnName="TRACK_2" attributeID="Track2" />
<Dependency ref="queryAttribute"/>
</DataConnector>
Activation (on a specific SP):
<bean id="aCondition" parent="shibboleth.Conditions.RelyingPartyId"
c:candidate="https://sp.example.org/shibboleth"/>
Q: Does the attribute <Dependency> say anything about whether the attribute exists or is populated?
If not, then if I want to guarantee a value is available to the query, does one need to add that to the activation condition?
<bean id="aCondition" parent="shibboleth.Conditions.AND">
<constructor-arg>
<list>
<bean parent="shibboleth.Conditions.RelyingPartyId"
c:candidate="https://sp.example.org/shibboleth" />
<bean class="net.shibboleth.idp.profile.logic.RegexAttributePredicate"
p:useUnfilteredAttributes="true"
p:attributeId="queryAttribute"
p:pattern="." />
</list>
</constructor-arg>
</bean>
Why? Because it appears that when queryAttribute isn't resolved/doesn't exist (idp-warn.log):
2018-01-18 17:26:32,691 - ERROR [net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.TemplatedExecutableStatementBuilder:209] - Error running template
org.apache.velocity.exception.VelocityException: Velocity template 7d474000-f81c-4a8b-875d-4996fb8686b6 threw an exception
at net.shibboleth.utilities.java.support.velocity.Template.merge(Template.java:238)
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'get' in class java.util.ArrayList threw exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at 7d474000-f81c-4a8b-875d-4996fb8686b6[line 3, column 46]
at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
2018-01-18 17:26:32,713 - ERROR [net.shibboleth.idp.profile.impl.ResolveAttributes:299] - Profile Action ResolveAttributes: Error resolving attributes
net.shibboleth.idp.attribute.resolver.ResolutionException: Error running template
at net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.TemplatedExecutableStatementBuilder.getSQLQuery(TemplatedExecutableStatementBuilder.java:210)
Caused by: org.apache.velocity.exception.VelocityException: Velocity template 7d474000-f81c-4a8b-875d-4996fb8686b6 threw an exception
at net.shibboleth.utilities.java.support.velocity.Template.merge(Template.java:238)
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'get' in class java.util.ArrayList threw exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at 7d474000-f81c-4a8b-875d-4996fb8686b6[line 3, column 46]
at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
2018-01-18 17:26:32,740 - WARN [net.shibboleth.idp.saml.nameid.impl.AttributeSourcedSAML2NameIDGenerator:154] - Unable to locate AttributeContext
2018-01-18 17:26:32,741 - WARN [net.shibboleth.idp.saml.nameid.impl.AttributeSourcedSAML2NameIDGenerator:154] - Unable to locate AttributeContext
2018-01-18 17:26:32,742 - WARN [net.shibboleth.idp.saml.nameid.impl.AttributeSourcedSAML2NameIDGenerator:154] - Unable to locate AttributeContext
2018-01-18 17:26:32,742 - WARN [net.shibboleth.idp.saml.nameid.impl.AttributeSourcedSAML2NameIDGenerator:154] - Unable to locate AttributeContext
Thanks!
Tom.
More information about the users
mailing list