Blog

 1 minute read.

Credential Checking at Crossref

It turns out that one of the things that is really difficult at Crossref is checking whether a set of Crossref credentials has permission to act on a specific DOI prefix. This is the result of many legacy systems storing various mappings in various different software components, from our Content System through to our CRM.

To this end, I wrote a basic application, credcheck, that will allow you to test a Crossref credential against an API.

There are two modes of usage. First, a command-line interface that allows you to run a basic command and get feedback:

          Usage: cli.py [OPTIONS] USERNAME PASSWORD DOI

Second, you can use it as a programmatic library in Python:

          import cred
          credential = cred.Credential(username=username, password=password, doi=doi)

          if not credential.is_authenticated():
          …

          if credential.is_authorised():
          …

The tool splits down authentication (whether the given username and password are valid) and authorisation (whether the valid credentials are usable against a specific DOI/prefix).

For technical information, the way this works is by attempting to run a report on the specific DOI in question and then scraping the response page. We hope, at some future point, that there will be a real API for this, but for now this solves the problem as a bridge.

Further reading

Page owner: Martin Eve   |   Last updated 2024-March-15