Citesphere uses OAuth2 for handling authentication and authorization. You can use any form of OAuth Client to get the token, which needs to be passed to other APIs as a header.

Authorizing Application

Prerequisites

  • You should have created an application in Citesphere. If not, create one!

  • You should have the following information for the application with you:

    • client_id - A unique identifier for your application. This is auto-generated for you during the application creation.

      • Example: OAUTHCLIENT007

    • client_secret - An auto-generated secret identifier which will be visible only right after you create the application. If you had lost it, go back and create a new application.

    • redirect_url - You should have given a callback URL while creating the application in Citesphere. If you forgot this, you can check it back in Citesphere.

Get Access Token

Status
colourYellow
titleENDPOINT Url
POST /api/v1/oauth/token

...

Name

Type

Description

client_id

string

Required. The client ID you received from Citesphere for your App.

client_secret

string

Required. The client secret you received from Citesphere for your App.

code

string

Required. The code you received as a response after the user gave the permission

redirect_uri

string

The URL of the application you configured in Citesphere

state

string

The unguessable random string you provided during the authorization step

grant_type

string

Required. Use authorization_code for retrieving anaccess_token.

For a list of values, check https://auth0.com/docs/applications/application-grant-types

...

Code Block
languagejson
{
    "access_token": "2c7c0f10-adf5-47d2ed55-a931-caeea29464edcaeea29464ee",
    "token_type": "bearer",
    "refresh_token": "0d06219a-1b49-49257895-9220-ef3b9810f09d",
    "expires_in": 406,
    "scope": "read"
}
  • expires_in specifies the number of seconds remaining for the access_token to expire.

  • You should use the access_token as the Bearer token header for accessing any resource.

    • Header Name - Authorization

    • Header Value - Bearer 2c7c0f10-adf5-47d2ed55-a931-caeea29464edcaeea29464ee

  • You should use the refresh_token in order to get a new access_token once it is expired

...