Last active
December 13, 2016 16:24
-
-
Save neverendingqs/611a944aa569f55a07196785404c9123 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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