Hi Matyas,

For demo.dspace.org, I can verify that we have not modified ANY ORCID 
configs from the default values *except* the "orcid.application-client-id" 
and "orcid.application-client-secret".  So, the orcid.cfg file is untouched 
and those two "orcid.application-client*" configs are modified in local.cfg

So, these defaults are what is in use:
https://github.com/DSpace/DSpace/blob/main/dspace/config/modules/orcid.cfg#L15-L20

Part of the issue here may be that you've modified several default values.  
I see you modified the "orcid.public-url" and "orcid.api-url".   Assuming 
you are trying to use the  ORCID sandbox (just for testing), you should 
revert those changes.  If you are trying to use the *public* ORCID, then 
you should use the settings recommended 
here: 
https://wiki.lyrasis.org/display/DSDOC7x/ORCID+Integration#ORCIDIntegration-Enabletheintegration

Currently, it appears your "public-url" is using the production API but 
your "api-url" is using the Sandbox API.  That may be causing your issues.  
You need to have everything using Sandbox or everything using the 
Production API... you cannot mix and match.

Tim

On Monday, September 4, 2023 at 2:30:46 AM UTC-5 matyas...@gmail.com wrote:

> Hi Tim!
>
> Thank you for response and confirming the problem is in JSON vs. XML API 
> response format.
>
> This are our orcid.cfg settings :
>
> # ORCID API (
> https://github.com/ORCID/ORCID-Source/tree/master/orcid-api-web#endpoints)
> orcid.domain-url= https://sandbox.orcid.org
> #orcid.domain-url= https://orcid.org
>
>
> orcid.authorize-url = ${orcid.domain-url}/oauth/authorize
> orcid.token-url = ${orcid.domain-url}/oauth/token
>
> orcid.api-url = https://sandbox.orcid.org/v3.0
> orcid.public-url = https://pub.orcid.org/v3.0
> #orcid.api-url = https://sandbox.orcid.org/
> #orcid.api-url = https://orcid.org/
> #orcid.public-url = https://pub.orcid.org/
> orcid.redirect-url = ${dspace.server.url}/api/authn/orcid
>
> # ORCID Credentials
> # Your public or member API Credentials, see
> # https://orcid.org/content/register-client-application-0
> # https://info.orcid.org/register-a-client-application-sandbox-member-api/
> orcid.application-client-id = APP-U02MD7G60UZ7O4LL
> orcid.application-client-secret = 9519762b-7660-48fa-a56f-952719df8430
>
> --------------------
>
> I have tried both
>
> 1. orcid.api-url = https://sandbox.orcid.org/v3.0
> 2. orcid.api-url = https://sandbox.orcid.org/
>
> but the result was the same.
>
> I have checked out ORCID account settings, but have found nothing there 
> about setting the response format.  In the ORCID documentation 
> https://info.orcid.org/documentation/api-tutorials/api-tutorial-read-data-on-a-record/
>   
> chapter "A note on content types" I read: "ORCID supports multiple content 
> types, including XML and several flavours of JSON. You can ask for your 
> preferred type by including an “Accept header” in your API requests. This 
> is called “content negotiation”."
>
> When I switched DSpace to debug mode, the log contains all headers in API 
> request - I attach it to this mail. I see no 'Accept' header would be added 
> by DSpace.
>
> Could you, please, check this at DSpace demo?
>
>
> Thanks in advance!  Best!
>
> Matyas
>
>
>
>
>
> Dne 01.09.2023 v 17:11 DSpace Technical Support napsal(a):
>
> Hi Matyas, 
>
> That does sound like the ORCID API is responding with JSON.  You may want 
> to check your ORCID configs closely, as DSpace *requires* using the XML 
> response of the ORCID APIs (ORCID APIs provide either a JSON or XML 
> response).  
>
> My suspicion is that one of your ORCID configs might be unexpectedly 
> causing you to get the JSON response... but I admit, I'm not sure which 
> one.  These are the configs I'm talking about: 
> https://wiki.lyrasis.org/display/DSDOC7x/ORCID+Integration#ORCIDIntegration-Enabletheintegration
>
> That's just a very quick guess.  Overall, I think we'd need more info 
> about your setup and configs to help out more.  I can verify that the ORCID 
> integration is working fine on our demo site (https://demo.dspace.org/) 
> using ORCID's Sandbox API.
>
> Tim
>
> On Friday, September 1, 2023 at 2:30:23 AM UTC-5 matyas...@gmail.com 
> wrote:
>
>> Hi! 
>>
>> Please, could you help me with ORCID API integration I am trying to 
>> implement?  I have made all settings as clearly described here 
>>
>> https://wiki.lyrasis.org/display/DSDOC7x/ORCID+Integration?src=contextnavpagetreemode
>>  
>>
>> Still, I get the following error in dspace.log and in new submission 
>> form I get suggestions only from Solr authorities, but no Orcid : 
>>
>> 2023-09-01 09:21:54,721 INFO fc77dd56-841e-4e6e-a659-e8ca1a98afa2 
>> 771249eb-c724-4a13-91a4-0c56bb2bf984 
>> org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter @ Before request 
>> [GET /server/api/sub 
>> mission/vocabularies/SolrAuthorAuthority/entries] originated from 
>> /workspaceitems/20/edit 
>> 2023-09-01 09:21:55,227 ERROR fc77dd56-841e-4e6e-a659-e8ca1a98afa2 
>> 771249eb-c724-4a13-91a4-0c56bb2bf984 
>> org.dspace.content.authority.SolrAuthority @ Error 
>> java.lang.RuntimeException: Unable to unmarshall orcid message: 
>> javax.xml.bind.UnmarshalException 
>>  - with linked exception: 
>> [com.sun.istack.SAXParseException2; lineNumber: 1; columnNumber: 16; 
>> unexpected element (uri:"", local:"html"). Expected elements are 
>> <{http://www.orcid.org/ns/common}orcid-identifier>,<{http://www 
>> .orcid.org/ns/search}search <http://orcid.org/ns/search%7Dsearch>>] 
>>         at 
>> org.dspace.external.provider.orcid.xml.Converter.unmarshall(Converter.java:43)
>>  
>>
>> ~[dspace-api-7.6.jar:7.6] 
>>
>> ------- 
>>
>> By this message, it looks to me that the response might be in JSON, but 
>> XML is expected by DSpace.  Or is there other problem? 
>>
>> Thanks a lot in advance!! 
>>
>> Regards! 
>>
>> Matyas F. Bajger 
>>
>> University of Ostrava - University Library, Czech Republic 
>> https://library.osu.eu 
>>
>>
>> -- 
> All messages to this mailing list should adhere to the Code of Conduct: 
> https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> --- 
> 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 dspace-tech...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dspace-tech/9c187773-58f1-47cc-9c3f-d6f011c815fbn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dspace-tech/9c187773-58f1-47cc-9c3f-d6f011c815fbn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
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 dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/7d867fdc-4784-49e5-93c5-7eb5cf47ce31n%40googlegroups.com.

Reply via email to