Found this content helpful? Log in or sign up to leave a like!

Unable to Generate Access Token for Student via Admin Access Token

Jump to solution
brandon42
Community Explorer

Hello Canvas Community,


We are working on an integration using the Canvas LMS API, and are attempting to generate an access token for a student using the endpoint: 

POST /api/v1/users/:user_id/tokens
https://www.canvas.instructure.com/doc/api/access_tokens.html

We are using an admin-level access token

However, we are experiencing issues:

  1. The token is not returned, or is returned in a "pending" state with no "token" value.

  2. There appears to be no way to activate the pending token programmatically or via impersonation.

  3. We could not find clear documentation or UI references on how a specific user (e.g., the student) can manually activate a pending token created by an admin

Labels (1)
0 Likes
1 Solution
chriscas
Community Coach
Community Coach

Hi @brandon42,

May I ask why you're attempting to create individual user access tokens?  I think that is going to be a very frowned upon practice overall.

The more common route would be to use a Developer Key / oAuth2 flow to be able to do API calls on behalf of users.

-Chris

View solution in original post