October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Integrate an App with Canvas LMS OAuth 2.0

A practical Canvas LMS OAuth 2.0 guide to developer keys, authorization-code setup, safe bearer-token use, refresh behavior, and public-client PKCE.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To connect an application to Canvas LMS on behalf of an individual user, use Canvas’s OAuth 2.0 authorization-code flow: have the institution enable a developer key, send the user to their Canvas host to authorize, exchange the returned one-time code for a token, and call the API with a bearer token over HTTPS. The Canvas host, key permissions, and client type all affect whether the integration works.

Choose user authorization or LTI service authentication

For a web application acting on behalf of a Canvas user, use the OAuth authorization-code flow. It obtains authorization in the user’s context. Canvas documents a separate client-credentials flow for LTI Advantage services: a deployed tool authenticates with a signed JWT assertion and receives access to resources associated with that tool. That service flow is not a substitute for a user’s authorization to a general API integration. See the Canvas OAuth documentation.

As an Amazon Associate I earn from qualifying purchases.

Get a developer key enabled for the right Canvas account

A developer key identifies the OAuth application; it includes a client ID and, for confidential clients, a client secret. On Canvas Cloud, an institution administrator issues and enables keys. An open-source Canvas installation can create credentials through site administration. A key created in a root account applies to that account and its subaccounts; globally created keys can work in accounts where they are enabled. Ask the institution administrator which key and Canvas host the integration should use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keys can be limited to particular API endpoint scopes. Request only the scopes the application needs, and confirm the key permits them. An API request outside the key’s granted scopes can return 401 Unauthorized; disabling the key can also block authorization or API calls. Removing a scope invalidates tokens derived from that key. Canvas documents an 8,000-character maximum HTTP header size that limits how many scopes a client can request in a single token request. Details are in Canvas Developer Keys.

If the application serves several institutions, treat each institution’s Canvas host and applicable key configuration as distinct. Canvas’s OAuth guide specifically advises LTI providers to identify the institution-scoped key using launch information such as custom_canvas_api_domain; do not assume one institution’s key works across all Canvas installations.

Run the authorization-code flow

1. Send the user to their Canvas host

Redirect the user to GET https://<canvas-host>/login/oauth2/auth with the required query parameters:

Rank #2
Sale
Thetis Nano-A FIDO2 Security Key Hardware Passkey Device with USB Type A, TOTP/HOTP, FIDO2.0 Two Factor Authentication 2FA MFA, Works with Windows/mac/iOS/Android/Linux/Gmail/Facebook/GitHub/Coinbase
  • Ultra-Compact FIDO2 Security Key - Plug-and-stay or carry on a keychain. This USB-A hardware security key offers portable, always-on protection for desktop and mobile use. (Item Size: 0.75 X 0.74 IN x 0.25 IN)
  • USB-A Hardware Key for All Devices - Works with USB-A ports on PC, Mac, Android, and other laptop/notebook device. Enables secure, cross-platform login with FIDO2.0 passkey support.
  • FIDO Certified Security Key - Meets FIDO and FIDO2 standards. Works with Google, Microsoft, GitHub, Dropbox, and more. Please check service compatibility before purchase.
  • Passwordless Login with Passkey - Supports passkey login via WebAuthn and CTAP2. Enjoy password-free sign-ins where supported. Not all websites or services currently support passkeys.
  • Advanced Multi-Factor Authentication - Offers 200 FIDO2 passkey slots and 50 OATH-TOTP slots. Strong, flexible 2FA/MFA support across various apps and authentication platforms.
  • client_id: the developer key’s client ID.
  • response_type=code: Canvas currently documents code as the supported response type.
  • redirect_uri: the application’s registered callback URI.
  • state: a fresh, unpredictable value associated with the user’s session.
  • scope: the endpoint scopes the application needs, as permitted by the key.

Use the user’s own Canvas installation as the host. When authorization succeeds, Canvas redirects to the callback with a code and the supplied state. If the user denies access or authorization fails, the callback receives an error parameter instead. Verify the returned state against the value stored for that session before taking further action.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Exchange the code for tokens

Send a POST request to https://<canvas-host>/login/oauth2/token with grant_type=authorization_code, the client credentials appropriate to the client type, the returned code, and the same redirect URI if one was supplied during authorization. Keep the redirect URI consistent across the round trip. Canvas invalidates the authorization code after exchange, so if a later step fails and the code is no longer usable, restart authorization. Never put a confidential client secret in a public client.

Rank #3
FIDO2 U2F Security Key Passkey Two-Factor Authentication (2FA) USB Key PIN+Touch (Non-Biometric) USB-A Type TrustKey T110
  • Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
  • Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
  • Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
  • Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
  • For the driver download and user guide, please visit TrustKey Solutions Home support page.

Canvas’s OAuth guide and OAuth endpoint reference describe the authorization and token endpoints.

Choose token handling based on client type

Confidential server-side applications

Keep client secrets and tokens in secure server-side storage. Canvas’s general OAuth guide says access tokens have a one-hour lifespan. For the confidential-client refresh flow it documents, send grant_type=refresh_token to the token endpoint; the response provides a new access token and the original refresh token is reused. Read the response’s expires_in value rather than assuming an access token remains valid indefinitely.

Rank #4
HORUSDY Tamper Proof Star Key Set (Folding) Security Torx Key Set Sizes Include T-6 to T-30
  • Tamper Resistant Star Key Set Crafted with premium chrome vanadium steel, and each star tool folds neatly into the handle for quick, easy access.
  • Details - The handle is engraved with size for quick identification with drilled tips to allow use.
  • Portable - Keys fold compact for easy storage, Drilled tips allow use on tamper resistant security screws.
  • Size:Full Size T-6, T-7, T-8, T-9, T-10, T-15 T-20, T-25, T-27 and T-30.
  • And with 10 total star sizes able to match nearly all standard tamper resistant security screws on the market.

Public apps, including SPAs and mobile apps

The Developer Keys API reference describes a client_type setting. Public clients require PKCE with the authorization-code flow, cannot use client credentials, and receive short-lived access tokens with rotating refresh tokens. This behavior is more specific than the general guide’s confidential-client refresh description: follow the behavior for the configured client type, and confirm that the target Canvas version and key configuration support the intended flow. See the Developer Keys API reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Send API requests without exposing tokens

Use the access token in the HTTP Authorization header over HTTPS:

Authorization: Bearer <access-token>

Canvas supports tokens in query strings or POST parameters, but discourages those methods because URLs and request parameters can be logged or otherwise exposed. Avoid asking users to create personal access tokens for a multi-user application; Canvas’s OAuth guide says that practice violates its API policy. Handle authorization and refresh failures without writing secrets, authorization codes, or tokens to logs.

Check these causes when authorization or API calls fail

  • Wrong host: the user is sent to a different Canvas installation than the one associated with the institution and key.
  • Key not enabled: ask the Canvas administrator to confirm the key is enabled for the relevant account.
  • Scope mismatch: compare requested scopes, key-granted endpoint scopes, and the endpoint being called.
  • Redirect mismatch or expired code: use the same redirect URI in the authorization and token requests, and begin a fresh authorization if the one-time code has already been exchanged or invalidated.
  • Incorrect client flow: use PKCE and rotating-refresh-token handling for a configured public client rather than assuming confidential-client behavior.
  • Changed scopes: if an administrator removed a key scope, tokens derived from that key are invalidated and authorization may need to be repeated.

Canvas documentation is moving to the Instructure Developer Documentation Portal after July 1, 2026. During implementation, check the current documentation and verify behavior against the institution’s Canvas version and configuration; the linked legacy documentation pages may move.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.