Thanks for your hint, helix. As I said, I had created the metadata field, 
so the problem was at another place:
https://github.com/DSpace/DSpace/blob/dspace-5.6/dspace-api/src/main/java/org/dspace/content/DSpaceObject.java#L1354

Here are some hardcoded fields, like eperson.phone etc. But there is no 
eperson.ou, that I needed. So this method just returned null and ruined the 
insert or update. Obviously its not as easy as described in 
authentication-shibboleth.cfg to use arbitrary fields for eperson.metadata 
to get from Shibboleth...

Thanks,
Oliver

Am Mittwoch, 4. Januar 2017 12:07:14 UTC+1 schrieb helix84:
>
> The root cause is non-existing metadata field [1] when setting [2] eperson 
> metadata. Obviously, this should be guarded against and throw a more 
> sensible error.
>
> Presumably you don't have the "cn" metadata atribute in the eperson schema 
> (it's not there by default) and you're trying to assign the Shibboleth 
> attribute value to it.
>
>
> [1] 
> https://github.com/DSpace/DSpace/blob/dspace-5.6/dspace-api/src/main/java/org/dspace/content/DSpaceObject.java#L1139
>
> [2] 
> https://github.com/DSpace/DSpace/blob/dspace-5.6/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java#L822
>
>
>
> Regards,
> ~~helix84
>
> Compulsory reading: DSpace Mailing List Etiquette
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>
>
> On Wed, Jan 4, 2017 at 11:49 AM, Oliver Goldschmidt <
> [email protected] <javascript:>> wrote:
>
>> Hello all,
>>
>> I have a problem trying to insert metadata attributes to an EPerson while 
>> authenticating with Shibboleth. The problematic option in 
>> authentication-shibboleth.cfg is the option eperson.metadata. I have set 
>> this option to 
>> eperson.metadata =  ou => ou
>>
>> I have created a field ou in the eperson metadata schema and I have a 
>> field ou in my Shibboleth headers. But authentication fails with this error 
>> message:
>>
>> 2017-01-04 10:51:01,887 ERROR org.dspace.authenticate.ShibAuthentication 
>> @ Unable to successfully authenticate using shibboleth for user because of 
>> an exception.
>> java.lang.NullPointerException
>>     at org.dspace.content.DSpaceObject.match(DSpaceObject.java:1139)
>>     at 
>> org.dspace.content.DSpaceObject.clearMetadata(DSpaceObject.java:1103)
>>     at 
>> org.dspace.content.DSpaceObject.setMetadataSingleValue(DSpaceObject.java:666)
>>     at org.dspace.eperson.EPerson.setMetadata(EPerson.java:909)
>>     at 
>> org.dspace.authenticate.ShibAuthentication.updateEPerson(ShibAuthentication.java:822)
>>     at 
>> org.dspace.authenticate.ShibAuthentication.authenticate(ShibAuthentication.java:221)
>> (...)
>>
>> I guess, the problem is, that some value is not set correctly, but I do 
>> not see the exact point of failure.
>>
>> I'm using DSpace 5.6.
>>
>> Any ideas?
>>
>> Thanks in advance
>> Oliver
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "DSpace Technical Support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/dspace-tech.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to