<div dir="ltr">HI,<div><br></div><div>I believe i have come across a defect in the OIDCAttributeMapperHelper class.  The issue occurs when you have a String Attribute which is set with no value using a custom federation provider.  The code blows up on the line:</div><div>return attributeValue.toString(); (Line 64)<br></div><div><br></div><div>in the section of code:</div><div><div>String type = mappingModel.getConfig().get(JSON_TYPE);</div><div>if (type == null) return attributeValue;</div><div>if (type.equals(&quot;boolean&quot;)) {</div><div>     if (attributeValue instanceof Boolean) return attributeValue;</div><div>     if (attributeValue instanceof String) return Boolean.valueOf((String)attributeValue);</div><div>     throw new RuntimeException(&quot;cannot map type for token claim&quot;);</div><div>} else if (type.equals(&quot;String&quot;)) {</div><div>     if (attributeValue instanceof String) return attributeValue;</div><div>     return attributeValue.toString();</div><div>} else if (type.equals(&quot;long&quot;)) {</div><div>     if (attributeValue instanceof Long) return attributeValue;</div><div>     if (attributeValue instanceof String) return Long.valueOf((String)attributeValue);</div><div>     throw new RuntimeException(&quot;cannot map type for token claim&quot;);</div><div>} else if (type.equals(&quot;int&quot;)) {</div><div>     if (attributeValue instanceof Integer) return attributeValue;</div><div>     if (attributeValue instanceof String) return Integer.valueOf((String)attributeValue);</div><div>     throw new RuntimeException(&quot;cannot map type for token claim&quot;);</div><div>}</div><div>return attributeValue;</div></div><div><br></div><div>The attribute exists with no value which causes the attrbuteValue to be null and there is no check for null at that point.  I would expect it would return empty string if the type is string and the value is null.</div><div><br></div><div>Thanks,</div><div>jeff</div></div>