Packed with powerful tools, customizable content and best-in-class service and support, Brightspace leaves the limitations of a traditional LMS in the dust.
Go to siteimport { axios } from "@pipedream/platform"
export default defineComponent({
props: {
d2l_brightspace: {
type: "app",
app: "d2l_brightspace",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://${this.d2l_brightspace.$auth.target_host}/d2l/api/lp/1.0/users/whoami`,
headers: {
Authorization: `Bearer ${this.d2l_brightspace.$auth.oauth_access_token}`,
},
})
},
})
D2L Brightspace uses OAuth authentication. When you connect your D2L Brightspace account, Pipedream will open a popup window where you can sign into D2L Brightspace and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any D2L Brightspace API.
Pipedream requests the following authorization scopes when you connect your account:
users:activation:read
accountsettings:locale:read
users:profile:read
GET
https://auth.brightspace.com/oauth2/auth
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://auth.brightspace.com/core/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://auth.brightspace.com/core/connect/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}