Skip to main content

ORCID integration with CKAN

Project description

Tests

ckanext-orcid

ORCID SSO integration for CKAN. Allows users to log in to your CKAN instance using their ORCID iD via OAuth2.

login example

Requirements

Compatibility with core CKAN versions:

CKAN version Compatible?
2.10 not tested
2.11+ yes

Installation

  1. Clone the source and install it on the virtualenv:
git clone https://github.com/DataShades/ckanext-orcid.git
cd ckanext-orcid
pip install -e .
  1. Add orcid to the ckan.plugins setting in your CKAN config file:
ckan.plugins = ... orcid
  1. Run the database migration:
ckan db upgrade
  1. Configure your ORCID credentials (see Obtaining ORCID credentials below).

  2. Restart CKAN.

Obtaining ORCID credentials

To enable ORCID login you need to register an application in the ORCID developer portal and obtain a Client ID and Client Secret.

Using the sandbox (recommended for development)

The ORCID sandbox is a free test environment with no real user data.

  1. Create a sandbox account at https://sandbox.orcid.org/register.
  2. Log in and go to Developer Tools (under your account name menu).
  3. If prompted, verify your email address first.
  4. Click Register for the free ORCID public API.
  5. Fill in the application details:
    • Name — your portal's name
    • Website URL — your CKAN instance URL (e.g. http://127.0.0.1:5000)
    • Description — short description of your portal
    • Redirect URIs — add your callback URL: http://127.0.0.1:5000/orcid/callback (replace the host with your actual domain in production)
  6. Save. You will be shown a Client ID (format APP-XXXXXXXXXXXXXXXXX) and Client Secret.

Set in your CKAN config:

  ckanext.orcid.client_id = APP-XXXXXXXXXXXXXXXXX
  ckanext.orcid.client_secret = your-client-secret
  ckanext.orcid.sandbox = true

Using the production ORCID registry

  1. Log in (or register) at https://orcid.org.
  2. Go to Developer Tools under your account menu.
  3. Click Register for the free ORCID public API and follow the same steps as above, using your production redirect URI (e.g. https://yourckan.example.org/orcid/callback).
  4. Copy the Client ID and Client Secret.

Set in your CKAN config:

ckanext.orcid.client_id = APP-XXXXXXXXXXXXXXXXX
ckanext.orcid.client_secret = your-client-secret

Note: ckanext.orcid.sandbox defaults to false, so omit it (or set it to false) for production.

Members API

Email retrieval from ORCID requires access to the ORCID Members API, which is only available to ORCID member organisations. The public API used above supports authentication (verifying a user's identity) but not reading private profile data such as email addresses. If your organisation is an ORCID member, contact ORCID support to obtain member API credentials and a separate client ID/secret with the /read-limited scope.

Config settings

Setting Required Default Description
ckanext.orcid.client_id yes OAuth2 Client ID from the ORCID developer portal
ckanext.orcid.client_secret yes OAuth2 Client Secret from the ORCID developer portal
ckanext.orcid.sandbox no false Set to true to use the ORCID sandbox environment

Tests

pytest --ckan-ini=test.ini

License

AGPL

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext_orcid-0.1.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_orcid-0.1.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file ckanext_orcid-0.1.0.tar.gz.

File metadata

  • Download URL: ckanext_orcid-0.1.0.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ckanext_orcid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29912ed5727f6e6c5473644012d5c367362e520c251373927e01d07f8e989b05
MD5 535eb2858d4cabb6c4327910c1852cb2
BLAKE2b-256 d876bc9bc7ee9d17245094add977486c1a14d7a6f35a9f22da5b9ef961ed7904

See more details on using hashes here.

File details

Details for the file ckanext_orcid-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ckanext_orcid-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ckanext_orcid-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c77fc08eb7d8413978ed8d710e9ace78d2ada5d7fb80414503da7d9150cb67c
MD5 8e47e6bd875d87173f07566c7086b7f1
BLAKE2b-256 2179115164e5b91551c2334d98c2b3fb0bb236b89017f6c70397064877bdb0ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page