Page tree
Contents

After ARDC has set up your IGSN account you will be issued with a username and password to use with the API.

Example:

  • Account Name: ANDS.EXAMPLE
  • Password: 5f4ab4cdeaa

To authenticate with the IGSN Service API, you can either use Basic Authentication or JWT Authentication

Basic Authentication

To use Basic Authentication, your credentials will need to be passed in as an Authorization HTTP Request Header 

PHP example:

  • Authorization: Basic '.base64_encode($app_id.":".$password) ; 
    OR
  • $str = base64_encode($app_id.":".$password);
    Authorization: Basic '.$str;

CURL example:

curl --request GET 'https://identifiers.ardc.edu.au/igsn-registry/api/me/' \
--header 'Authorization: Basic QU5EUy5FWEFNUExFOiA1ZjRhYjRjZGVhYQ==' \

JWT Authentication

IGSN Registry uses ARDC Authentication Service which provides an OpenID Connect (oauth2) protocol. The openid connect endpoint configuration is available at https://auth.ardc.edu.au/auth/realms/ARDC/.well-known/openid-configuration

To use JWT authentication you need to obtain an Access Token first.

eg.

curl --request POST 'https://auth.ardc.edu.au/auth/realms/ARDC/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=igsn-frontend' \
--data-urlencode 'username=ANDS.EXAMPLE' \
--data-urlencode 'password=5f4ab4cdeaa'

The request response would look something like

{
    "access_token": "${accessToken}",
    "expires_in": 300,
    "refresh_expires_in": 1800,
    "refresh_token": "${refreshToken}",
    "token_type": "bearer",
    "not-before-policy": 0,
    "session_state": "a31832d7-95e7-4d78-a249-a7c93b496a00",
    "scope": "profile email"
}

Where the access_token would be the access token

The access token is short lived and is only valid for 300 seconds, the refresh token is provided so the user could use the refresh token to obtain another access token.

Then then Access Token can be used as a Bearer Authorization, eg

curl --request GET 'https://identifiers.ardc.edu.au/igsn-registry/api/me/' \
--header 'Authorization: Bearer ${accessToken}' \
  • No labels

This page has no comments.