Ajax-loader-large-white
OAuth2
Getting out of the flow

Since the web flow is the usual means of creating access tokens, many developers dread getting started with an OAuth2 API. Fortunately, many sites have other means of generating tokens for developers that make it easy to get started.

The GitHub Authorizations API lets developers create access tokens using Basic Auth. We're going to use John Nunemaker's HTTParty library to create a small Ruby wrapper for part of the GitHub API.

To start we need to POST to the /authorizations method to create a new access token.

Instructions

Supply the API endpoint "https://api.github.com/authorizations" for the endpoint variable.

?
Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

You'll need to add the following right below def create_token:

endpoint = "https://api.github.com/authorizations"
script.rb