Follow this repos instructions to get your credentials with Instagram and add them to the project. Get the project to authenticate and consume the API.
- Ports are important...
- Examples:
- Website URL:
http://localhost:9393/
- Redirect URL:
http://localhost:9393/auth/callback
- Website URL:
config.client_id = "2b089c3e792e413e83df3a594xxxxx"
config.client_secret = "9302a2b100ae4494a8d43c65xxxxxx"
Ideally you put this in an .env file ;)
0 bundle install
1 Shotgun
2 Visit '/'
3 Press the Instagram Logo
4 Authorize
5 PROFIT!!!
In the servers logs (terminal)
"######### accsess_token ##############"
"369004168.2b089c3.b8f0a8115c144dxxxxxxx"
"--------------------------------------"
-
Step 0: Provide a way to manage a ridirect to the third party login.
-
Step 1: Redirect the users to the third party Auth url. This redirect usually require send some query params to notify the third party who you are and where are you comming from.
-
Step 2: The third party service will responde back to your application to the callback URL. In this case they are responding with a code. Look the what the params have.
-
Step 3: Once you have the code. Format a Post request to get an access token and some Users information. Inspect the response out of that Post. Use this info to create a user in your DB save and the token in the sessions hash.
-
Step 4: Use the access token saved in the session hash to consume the API.
We are using the instagram gem.
If you want to see what the gem is doing on each step:
Replace the usage of the API wrapper for your own url formating and HTTP requests using plain vanilla ruby.
Encapsulate your interaction with the API using HTTParty.
- Add user model
- Hook MongoDB and use it somehow