Authentication

This page is under construction
We’re working on it!

Table of Contents

  1. Authentication using login and password
  2. Authentication using vault approle
  3. Token Refresh
  4. Authentication using launcher credentials



1. Authentication using login and password


API endpoint that allows authentication process for front-end.

Request

ConceptData
HTTP MethodPOST
Path/api/v2/auth/login
Content Typeapplication/json

Parameters

Request parameters.
NameTypeComments
email
required
string-
password
required
string-
realmstringIf the system allows several authentication methods, this parameter indicates which one is used.
Default: "api"
Response parameters are included in a "token" object.

NameTypeComments
access_token
required
string-
refresh_token
required
string-

Request sample

{
  "email": " inst_admin@example.com", 
  "password": "string"
} 

Responses

Response sample

200
{
  "token": {
    "access_token":"8cdbacfe-de57-4c44-ad67-62f665bebfab", 
    "refresh_token":"0f1d9342"
  }
}

2. Authentication using vault approle


API endpoint that creates the access token for the SDK.

Request

ConceptData
HTTP MethodPOST
Path/api/v2/auth/approle
Content Typeapplication/json

Parameters

Request parameters.
NameTypeComments
role_id
required
string-
secret_id
required
string-
Response parameters are included in a "token" object.

The response also includes a complete VLE configuration that is not listed in the below table (See Response Sample section for a code sample).

NameTypeComments
access_token
required
string-
refresh_token
required
string-

Request sample

{
  "role_id": "bad6209f-4310-4621-aa09-22178e71a7a9", 
  "secret_id": "1211c5e7-d122-437b-9e45-824aa498bae9"
} 

Responses

Response sample

200
{
"apps": [], 
"config": { "TESLA_DOMAIN": "string" }, 
"description": "string", 
"domain": "string", 
"institution_acronym": "default", 
"institution_id": 1, 
"module": "string", 
"services": {}, 
"vle_id": 1, 
"vle_name": "default_moodle", 
"vle_url": "string", 
"type": "vle", 
"pk": 1, 
"vle": { 
  "id": 1, 
  "lti": { 
    "consumer_key": "0e55ff96-6a87-46bf-bfe9-09a882282d0d", 
    "consumer_secret": "dd5c2714-f66a-4066-9b51-ac51b1f35a39"
  }, 
  "name": "default_moodle", 
  "type": 0, 
  "url": "string", 
  "client_id": null, 
  "created_at": "2021-10-07T10:25:15.580239Z", 
  "updated_at": "2021-11-15T15:24:33.985594Z", 
  "institution": 1
}, 
"token": { 
  "access_token": "ad56bb9e-c468-4c93-aef5-68048707b4bc", 
  "refresh_token": "b96ac612-8473-423b-ac8b-3829a81afd7f"
} 
}

3. Token Refresh


API endpoint used for recreating main token when it is expired.

Request

ConceptData
HTTP MethodPOST
Path/api/v2/auth/token/refresh
AuthorizationJWT
Content Typeapplication/json

Parameters

Request parameters.
NameTypeComments
refresh_token
required
string-
Response parameters are included in a "token" object.
NameTypeComments
access_token
required
string-
refresh_token
required
string-

Request sample

{ 
  "refresh_token": "f59fc2e6-58e9-44a7-a398-a5c214a35ee7"
} 

Responses

Response sample

200
{
"token": {
  "access_token": "fe67d841-5c6b-4799-b22c-a9493c401161",
  "refresh_token": "4e183261-d394-4004-af96-017238668d42"
}
}

4. Authentication using launcher credentials


API endpoint that allows VLE user authentication for front-end using launcher credentials.

Request

ConceptData
HTTP MethodPOST
Path/api/v2/auth/token
Content Typeapplication/json

Parameters

Request parameters.
NameTypeComments
launcher_id
required
string-
token
required
string-
Response parameters are included in a "token" object.
NameTypeComments
access_token
required
string-
refresh_token
required
string-

Request sample

{
  "id": "string", 
  "token": "string"
} 

Responses

Response sample

200
{
  "token": {
    "access_token":"string", 
    "refresh_token":"string"
  }
}