February 2019
Intermediate to advanced
626 pages
15h 51m
English
The next step is to create an access token. The access token is valid for a limited time.
The clientSecret is sent with this request; if this were an application that was given to others, keeping the secret would be a challenge to overcome:
$params = @{ Uri = 'https://github.com/login/oauth/access_token' Method = 'POST' Body = @{ client_id = $clientId client_secret = $clientSecret code = $authorizationCode }}$response = Invoke-RestMethod @params$token = [System.Web.HttpUtility]::ParseQueryString($response)['access_token']
The previous request used the HTTP method POST. The HTTP method, which should be used with a REST method, is documented for an interface in the Developer Guides.
Each of the requests that follow ...
Read now
Unlock full access