How Access tokens can be generated automatically for each user .

Jump to solution
PraveenShukla
Community Member

Hi Team,

I am creating one app where I am using canvas LMS Rest  Apis but right now I have created the access token manually which  I am using to get the data from APIs .

but if I wanted to get data for specific users then how I can generate the token for users automatically? I don't want to create tokens manually.

 

 

 

 

Labels (3)
0 Likes
1 Solution
jerry_nguyen
Community Contributor

@PraveenShukla 

You can use "Masquerading" to send API requests as another user instead of creating an access token for that user, this is useful when you wanted to perform an action on behalf of a user  

https://canvas.instructure.com/doc/api/file.masquerading.html

However, if your account is an Admin, you can get data for any users without their API token.

If you're designing an app for users to utilise API, you will need to implement OAuth2, which requires a user to login to Canvas using their credentials then it will generate the necessary API token for the user to perform API requests.  

https://canvas.instructure.com/doc/api/file.oauth.html

 

View solution in original post