Skip to content

Instantly share code, notes, and snippets.

@neverendingqs
Last active December 13, 2016 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neverendingqs/611a944aa569f55a07196785404c9123 to your computer and use it in GitHub Desktop.
Save neverendingqs/611a944aa569f55a07196785404c9123 to your computer and use it in GitHub Desktop.
Dim client As New RestSharp.RestClient("https://auth.brightspace.com/core/connect/token")
' Must use basic auth
client.Authenticator = new HttpBasicAuthenticator("(client id)", "(client secret)");
Dim req As New RestSharp.RestRequest(Method.POST)
req.AddHeader("Content-Type", "application/x-www-form-urlencoded")
req.AddHeader("Accept", "application/json")
req.AddParameter("grant_type", "refresh_token")
req.AddParameter("refresh_token", "(manually obtained refresh token)")
req.AddParameter("scope", "Application:*:* Core:*:* Data:*:*")
Dim resp As RestSharp.IRestResponse = client.Execute(req)
' `resp.Content will` be a JSON object; use "access_token" in your request,
' and store "refresh_token" for your next request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment