Canvas LMS is a learning management system for school classrooms. An application can use the API to access data, but only with an API token. Some integrations require a token manually generated from the user's settings page.
Some institutions don't let you generate one. This page will discuss extracting a token manually from a rooted Android device signed in to the user's account on the Canvas Student app as of version 6.21.2 (246).
Two files, both in /data/data/com.instructure.candroid/shared_prefs/
, contain the accessToken
:
/data/data/com.instructure.candroid/shared_prefs/canvas-kit-sp.xml
/data/data/com.instructure.candroid/shared_prefs/signedInUsersList.xml
A sample Python script requiring parsel is provided for extraction.
The token is directly in the XML element.
XPath | CSS |
---|---|
//map/string[@name="accessToken"]/text() | map > string[name=accessToken]::text |
The token is in a JSON object within the XML element, where all the quotes are escaped as "
.
XPath | CSS |
---|---|
//map/string[@name]/text() | map > string[name]::text |