CrossRef plugin registration not successful 401 Unauthorized

The CrossRef Export plugin cannot directly deposit data with CrossRef, we get a wrong credentials error even though our credentials are correct.

OJS version 3.3.0.13, PHP 7.4.33, mysql 5.7.37, CrossRef export plugin version 2.1.0.0.

Going to Tools > CrossRef XML Export Plugin > Articles, selecting an article and hitting “Deposit” (with or without “Validate XML” checked), we get the error:

Registration was not successful! The DOI registration server returned an error: '(401 Unauthorized)'. 

But:

  • The credentials, double-checked with CrossRef, are correct. I’ve tried the simple Role form (which CrossRef says should work) but also
    email@server.com/role with each of our email addresses that CrossRef knows about (technical contact, etc.) I’ve re-entered the password several times, typing it in as well as copy/pasting it.
  • We’re able to manually deposit OJS-generated XML records through CrossRef’s own administration console.
  • Our OJS server is able to do a Curl https request to CrossRef’s API. I’ve tried that with a simple script (see below).
  • We have the latest version of the plugin, 2.1.0.0.
  • The error happens with automated deposits (as an article is published) as well as when we use Tools > CrossRef XML Exports and select some articles to deposit. I’ve seen that in the scheduledTasks logs.

Possibly relevant: our CrossRef password includes an underscore.

Any suggestions re what may cause the error or what further tests I might do?

For reference, here are previous posts I found on the issue:

I contacted CrossRef’s support to check the credentials. Here’s their answer:

That 401 error almost always indicates a problem with your user credentials.
We’re in the midst of a very gradual transition from an authentication system where each Crossref member organization has a single username to a system where any staff member at a member organization can have their own email-based username, which is attached to the organization’s username, which we then call their “role”.
Your account still uses the old system, so you have a single username and its password. There’s no email address involved in your account credentials.
So, in your OJS Crossref XML Export Plugin settings, the username field should contain only: [our username]
And the password field should contain whichever password you created for that username.
If that same username/password combination is still giving you a 401 error in OJS, we may be at the limit of how much we can support you with it. OJS is not our product, so we’re relatively limited in how much we can help with its use.

I’ve tried the recommend username/password. For good measure, I’ve tried various email@server.com/role combinations. None have worked.

Curl test. As suggested in this discussion I’ve tested whether our server could to an (anonymous) SSL cURL request with Crossref. I’ve ran the following script on our server:

<?php
error_reporting(E_ALL);
$request = urlencode('Towards a Unified Theory of High-Energy Metaphysics, Josiah Carberry 2008-08-13');
$request = 'https://api.crossref.org/works?query.bibliographic="'. $request . '"&rows=2';
$ch = curl_init($request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

print '[' . $httpcode . ' - ' . strlen($response) . ' chars]'."\n";
?>

The request works, I get a HTTP 200 code:

[200 - 9977 chars]

My next step is to try and change our CrossRef password. In the meanwhile, any help is welcome.

I have same problem, I changed my CrossRef password, but there is still same problem.

We also had the same problem, We were not able to fix it. Instead we used the web deposit to deposit data

Thanks both. I can confirm the issue persists. I’ve changed our Crossref credentials to email/role, changed the password, used a password without special chars: no luck.

Maybe this is caused by our server’s configuration (esp PhP / cURL config?). OJS is supposed to check that the Php settings are suitable, but perhaps the plugin doesn’t? My version is:

LiteSpeed V8.0.1 Cloudlinux 1.3
PHP 7.4.33
Zend Engine v3.4.0,
cURL 7.71.0

I don’t think I should post our PhP / cURL config here but I’ll ask CrossRef if they can see something wrong with it.

SOLVED. I had forgot to uncheck “Use the CrossRef test API (testing environment)” on the plugin setup page! Hope this may help some of you too.

No, I have had the same issue, after unchecking, there is series of errors, including 403, it also says ISSN is already with different title