Get ID Token
The ID Token is the main piece of data in the LTI® protocol, it's sent by the LMS to the LTI® tool and contains information regarding the current LTI® launch, this includes user information, LMS information, launch context information and everything you need to use the many LTI® services.
LTIAAS gives you access to a launch specific ID Token, formatted for easy of use, through the /api/idtoken
API endpoint.
Please check our Retrieving the ID Token guide to learn more about using this endpoint.
API Authentication Method | Supported |
---|---|
LTIK-AUTH-V2 | ✅ |
SERVICE-AUTH-V1 | |
Bearer |
Query Parameters
If true, returns an unformatted version of the ID token.
- 200
- 401
Schema
user object required
platform object required
launch object
services object required
{
"user": {
"id": "2",
"roles": [
"http://purl.imsglobal.org/vocab/lis/v2/membership#Instructor"
],
"email": "john@lms.com",
"name": "John Doe",
"givenName": "John",
"familyName": "Doe"
},
"platform": {
"id": "0c41aa0849215449d4298e58f7626c68",
"url": "https://lms.example.com",
"clientId": "KzJtrQxEUYGWXjx",
"deploymentId": "1",
"name": "LMS",
"guid": "lms.example.com",
"productFamilyCode": "lms",
"version": "2020073000",
"description": "LMS",
"contactEmail": "contact@lms.com"
},
"launch": {
"type": "LtiResourceLinkRequest",
"target": "https://your.ltiaas.com/lti/launch",
"context": {
"id": "2",
"label": "course",
"title": "Course",
"type": [
"CourseSection"
]
},
"resourceLink": {
"id": "1",
"title": "Activity",
"description": "Activity 1"
},
"presentation": {
"locale": "en",
"document_target": "iframe",
"returnUrl": "https://lms.example.com/course/1",
"width": 1300,
"height": 964
},
"custom": {}
},
"services": {
"deepLinking": {
"available": true
},
"namesAndRoles": {
"available": true
},
"assignmentAndGrades": {
"available": true,
"lineItemId": "https://lms.example.com/course/1/lineitems/1"
},
"serviceKey": "eyJhbGciajsheu..."
}
}
Unauthorized. Please check our guide on Authenticating API requests to learn about how authentication works in the LTIAAS API.
Schema
Default value: 401
Default value: Unauthorized
details object required
{
"status": 401,
"error": "Unauthorized",
"details": {
"message": "INVALID_LTIK_AUTH_AUTHORIZATION_HEADER",
"description": "Invalid or expired ltik."
}
}
{
"status": 401,
"error": "Unauthorized",
"details": {
"message": "INVALID_LTIK_AUTH_AUTHORIZATION_HEADER",
"description": "Invalid or expired ltik."
}
}
GET /api/idtoken
Authorization
name: Authorizationtype: apiKeyin: headerdescription: An http Header who's value is of the format: `LTIK-AUTH-V2 <API_KEY>:<ltik>`. Where <API_KEY> should be replaced with your static API Key provided by LTIAAS and <ltik> is the ltik value passed to you on each new launch of your tool. Learn more about this in the <a href="/guides/api/authentication">Authenticating API requests</a> guide.
Request
Request
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/idtoken';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/idtoken';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/idtoken';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/idtoken';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/idtoken';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/idtoken';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}
const axios = require('axios');
const url = 'https://your.ltiaas.com/api/idtoken';
const config = {
headers: {
'Authorization': `LTIK-AUTH-V2 ${API_KEY}:${ltik}`
}
};
try {
const response = await axios.get(url, config);
console.log(response.data);
} catch(error) {
console.log(error);
}