-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to register with ORCID due "ORCID CURL error: .... Unexpected ORCID API response: 302" #300
Comments
It seems ORCID is introducing further redirects -- it seems a redirect occurs here as well, and in 3.2.1 we did not consider/allowed the redirection -- in 3.3. and 3.4. we now use Guzzle and we could set it to follow POST redirections, so this should not be a problem in 3.3 and 3.4. I will check if something similar can be done for 3.2.1 too... |
Hmmm... strange... I have just installed 3.2.1 (from stable-3_2_1 branch) and I do not get that error i.e. I am normally redirected to that https://orcid.org/signin?client_id=...&response_type=code&scope=%2Fauthenticate&redirect_uri=http:%2F%2Fojs-3-2-1.bb%2Findex.php%2Fpublicknowledge%2Forcidapi%2ForcidAuthorize%3FtargetOp%3Dregister in the popup window and then after signing in to the user registration in OJS again, and my ORCID token is there/saved... 🤔 |
Hmmm... I do not understand why I do not get the 302 -- I get 200 -- at that same part of the code. Although when I call that URL https://orcid.org/v3.0/.../person directly in the browser I see first 302 in browser's developer tools... |
@marcbria, what PHP and PHP CURL version do you have and what browser did you use? |
About curl, I use the one included in the alpine docker image:
About the browser... it happens with Firefox and Chromium, but final users also reported the issue: Chromium Firefox |
Actually I think your CURL behaves correctly, but I do not know why my does not behave in the same way :-(
I think I need @asmecher 's help :-) |
From inside the container when asking curl_getinfo() for the same url you asked I get a 302:
I also tired:
I got a 302 in all cases, so I though it could be related with running inside a container (docker proxy, etc) but then I ran curl directly from my server and home's shell and I also got a 302 all the time:
Finally I tried to visit the url from my browsers, and the result was the same. Thanks for your time and your help Bozana, m. Details of the test...I used the following script (just in case I made something wrong): $url = 'https://orcid.org/v3.0/0000-0001-8915-5620/person';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error en la solicitud cURL: ' . curl_error($ch);
exit;
}
$info = curl_getinfo($ch);
curl_close($ch);
print_r($info); And the docker call was:
|
Hey @marcbria, And check if the registration works? |
Now I am a little bit worried if I can test correctly the other versions, 3.3 and 3.4 -- because even for 3.2.1 it works for me... :-\ |
You are a wizard! Now works better, but still not perfect. The popup window raises and I can fill it, but then ORCID data (name, surname...) is not transfered back to the OJS login form.
If you are not in a Mac, you can test it over docker if you like. ;-) Works fine with linux and windows. I still need to fix the way we build the images to be compatible with Mac. |
Hi @marcbria, |
@marcbria do you mean the general registration form ? If I understand correctly, your are referring to the login form. http://localhost/ojs/index.php/xyz/user/register?source= I tested the OJS 3.2.1 branch on php 7.4, and name, surname and orcid are passed. The registered credentials are not passed, but that is a limitation, which is why I removed registration completely in 3.3+. Since there was no proper way to move received orcid values properly, previous developers had added the following javascript function to move the values. https://github.com/pkp/orcidProfile/blob/stable-3_2_1/pages/OrcidHandler.inc.php#L136 Therefore , if you are going to still use this function , I would check that if the javascript is called correctly. |
Yes, it is. Here you have an example: https://papers.uab.cat/user/register As you will notice, there is no track of the javascript added to move the values. BTW, I added the CURLOPT_FOLLOWLOCATION variable in L100, but I think it need to be added in every curl_setopt_array, isn't it? |
Hi @withanage, when I tested it, I only get this from ORCID: |
Hi @marcbria, yes, I will soon change the code to insert CURLOPT_FOLLOWLOCATION everywhere... |
And finally, @withanage, we did not know you turned the registration button off for reason, so @ewhanson introduced it again here: #294. The button was also there in 3.4, it seems... |
Take a look to #266 for a detailed explanation. |
yes, the important reason was that the orcid authentication tokens, were not communicated. orcid-register.webmSomehow it works for me, which is strange for me too looking at the API response. |
@ewhanson tested it yesterday, and found out that the person's data are available and overtaken into our registration form when the member API is selected in the plugin... |
I confirm our service is poor and we can't pay ORCID 5K every year... :-( |
OrcidHandler.inc.php: I hope this completely solved the issue. I am using a Public API. OJS 3.2.0.3. ORCID 1.1.2.3, PHP 7.3.33. @bozana, thank you very much. If this works, then I'll drink to your health, dude! 🥂 |
Describe the bug
On OJS 3.2-stable (dockerized), with the last version of the orcid plugin (1.1.2.30 / 2023-10-31), new users can not register (popup window emerges and disapears).
In server side, log show the following error error:
To Reproduce
Steps to reproduce the behavior:
Additional context
In the other hand, contributors are able to bound their orcid with OJS without any trouble.
The text was updated successfully, but these errors were encountered: