Skip to content

Instantly share code, notes, and snippets.

@hundredwatt
Last active December 18, 2015 11:49
Show Gist options
  • Save hundredwatt/5778136 to your computer and use it in GitHub Desktop.
Save hundredwatt/5778136 to your computer and use it in GitHub Desktop.
1. To start the OAuth Flow, send the user to:
https://accounts.gaggleamp.com/oauth/authorize?
client_id=%CLIENT_ID%&
redirect_uri=%REDIRECT_URI%&
response_type=code
Where `%CLIENT_ID%` is your applications consumer key and `%REDIRECT_URI%` is the location the redirect location for your application.
2. After completing the OAuth flow successfully, the user will be redirected back to your application with a short-lived verification code:
%REDIRECT_URI%?
response_type=code&
code=%VERIFICATION_CODE%
3. Your server can now make a background request to trade the verification code for an access token and refresh token. This request is authenticated via HTTP Basic Auth with the `client_id` as the username and `client_secret` as the password:
POST https://%CLIENT_ID%:%CLIENT_SECRET%@accounts.gaggleamp.com/oauth/token?
grant_type=authorization_code&
code=%VERIFICATION_CODE%
The response will be a JSON object:
{
access_token: "%ACCESS_TOKEN%",
token_type: "bearer",
expires_in: "%SECONDS_TILL_EXPIRATION%",
refresh_token: @authorization.refresh_token
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment