Updated in November 2026 to include steps to use Bruno.
Overview
This guide uses the OAuth 2.0 authorization code flow to register an OAuth 2.0 app and call the whoami Brightspace API route. This request returns data for the user associated with the access token.
Before you begin
Install Postman or Bruno.
Choose one of these setup paths:
- A test Brightspace instance where you have a login with the following permissions:
- Manage Extensibility > Can Manage API Applications
- Service Users
- See Service Users Tool
- Create a Service User
- Modify Service User Permissions
- Org Unit Editor > Add/edit new and existing Org Unit Types
- Tool Management > See Org Tool Management
- If an administrator has already registered the OAuth 2.0 app in a test Brightspace instance, you can use:
Determine the version of the API to use
Brightspace API routes use versioning. To determine the version of the API to use, you need to know:
- The component of Brightspace that the API route belongs to. This is the third segment of the route. In
/d2l/api/lp/(version)/users/whoami, this segment refers to Learning Platform (LP). - The current version of the Brightspace API for the component. Refer to What's in the Brightspace developer platform? for the current version of the LP component
The API reference for the route also indicates the oldest fully supported version of the API (“Route first appears in…”). This information is relevant for existing extensions. New extensions should use the current version of the component API.
Obtain OAuth 2.0 credentials
- From Admin Tools, click Manage Extensibility.
- Click the OAuth 2.0 tab to view the list of registered applications.
- Click Register an app. The Register an Application page opens.
- Under Grant Type, select Authorization.
- For Application Name, enter a name that identifies the app, such as whoami quickstart. If you enable user consent prompts, Brightspace displays this name when a user is asked to approve the app’s access to their account.
- Enter a Redirect URI.
- For Postman with Authorize using browser, enter
https://oauth.pstmn.io/v1/browser-callback. - For Bruno, enter
https://oauth.usebruno.com/callback.
- In Scope, enter
users:own_profile:read. - If you don’t want Brightspace to show a consent prompt, clear Prompt for User Consent? If you leave this option selected, the user must approve the app in the browser.
- Review and accept the API Developer Agreement.
- Click Register. Brightspace displays the client ID and client secret. Copy both values and store the client secret securely.
Make the request using Postman
Use the app’s client ID and client secret to request an access token and then use the token to call the API.
- Allow your browser to open Postman from
https://oauth.pstmn.io/. Postman uses your default browser to complete authorization and return the token to Postman. - In Postman, create a
GET request to {{BrightspaceDomain}}/d2l/api/lp/{{apiVersion}}/users/whoami. For steps, see Create a new request. - Set the
BrightspaceDomain and apiVersion variables. Include https:// in BrightspaceDomain and don’t include a trailing slash. For example, https://example.brightspace.com. - On the Authorization tab, configure OAuth 2.0 authorization:
- For Auth type, select OAuth 2.0.
- Scroll to Configure New Token.
- Enter a name for the token.
- For Grant Type, select Authorization Code.
- Select Authorize using browser.
- For Auth URL, enter
https://dev-auth.brightspace.com/oauth2/auth. - For Auth Token URL, enter
https://dev-auth.brightspace.com/core/connect/token. - In Client ID and Client Secret, enter the values from the registered app.
- In Scope, enter
users:own_profile:read. - Click Get new access token.
- If you enabled user consent prompts, click Accept in your browser to let the app access your account.
- When prompted by your browser, click Open.
- In Postman, click Use Token.
- Close the browser window.
- Next to the request URL, click Send. A successful request returns HTTP 200 OK and a response similar to this example:
{
"Identifier": "182",
"FirstName": "Test",
"LastName": "User",
"Pronouns": null,
"UniqueName": "TestUser",
"ProfileIdentifier": "oVYdVPfnCc"
}
Make the request using Bruno
Use the app’s client ID and client secret to request an access token. Then use the token to call the API.
- Allow your browser to open Bruno from
https://oauth.usebruno.com/callback. Bruno uses your default browser to complete authorization. - In Bruno, create a
GET request to {{BrightspaceDomain}}/d2l/api/lp/{{apiVersion}}/users/whoami. For steps, see Create a request. - Set the
BrightspaceDomain and apiVersion variables. Include https:// in BrightspaceDomain and don’t include a trailing slash. For example, https://example.brightspace.com. - On the Auth tab, configure OAuth 2.0 authorization:
- For Auth type, select OAuth 2.0.
- For Grant Type, select Authorization Code.
- Leave Callback URL blank when you select Use system browser for OAuth.
- Select Use system browser for OAuth.
- For Authorization URL, enter https://dev-auth.brightspace.com/oauth2/auth.
- For Access Token URL, enter https://dev-auth.brightspace.com/core/connect/token.
- In Client ID and Client Secret, enter the values from the registered app.
- In Scope, enter users:own_profile:read.
- For Add credentials to, select Basic Auth Header.
- Scroll down, and then click Get new access token.
- If you enabled user consent prompts, click Accept in your browser to let Bruno access your account.
- In Bruno, click Save.
- Next to the request URL, click Send. A successful request returns HTTP
200 OK and a response similar to this example:
{
"Identifier": "182",
"FirstName": "Test",
"LastName": "User",
"Pronouns": null,
"UniqueName": "TestUser",
"ProfileIdentifier": "oVYdVPfnCc"
}
Troubleshooting
Token request errors
- If your browser returns to Bruno but Bruno doesn’t display Token Fetched Successfully, allow pop-ups from
https://oauth.usebruno.com/callback in your default browser. - If your browser returns to Postman but Postman doesn’t display Token Fetched Successfully, allow pop-ups from
https://oauth.pstmn.io/ in your default browser. - If you get an unregistered client error, check that the client ID belongs to an app registered on the Brightspace instance that you’re authenticating with. For a production instance, use these authorization and token URLs:
- https://auth.brightspace.com/oauth2/auth
- https://auth.brightspace.com/core/connect/token
- If you get the message
Invalid client_id format, expected GUID, the client ID might contain whitespace, such as \n. Remove any whitespace from the client ID in Bruno or Postman and then try again.
API request errors
- If you get HTTP 404 Not Found, check that the request URL doesn’t end with a trailing slash (
/).