Giter VIP home page Giter VIP logo

instagram-web-oauth's Introduction

Instagram Oauth2.0 for Web

The easiest way to create authentication flow with Instagram.

You can also check react-instagram-photo-picker which uses this module for authorization.

Requirements

First of all go to Instagram Developer Console and create your app.

After creating app go to: Manage Clients -> Manage -> Security.

Some important notes:

  1. Disable implicit OAuth - must be unchecked, otherwise we will not be able to use Implicit flow!

  2. Valid redirect URIs - add URI from where you are calling instagram authorization.

For example your redirect URI can look like this: http://localhost:3000/.

Demo

Usage

Usage is very simple it requires just 3 lines of code :)

  1. Put this line of code in </head> tag.
<head>
  <script src="https://instagram-web-auth.firebaseapp.com/instauth.min.js"></script>
    ...
</head>
  1. Put this line of code in </body> tag.
<script>
  window.InstAuth.init(your_client_id_from_instagram_console);
</script>
  1. Call startAuthFlow() everywhere user clicks 'Log in to Instagram'
  window.InstAuth.startAuthFlow();

After successful authorization in console you should notice this message:

Instagram access_token: 707...46b4

And that's all :)

You can get your access_token any time using this line of code:

var token = window.InstAuth.getAccessToken();

Summary

I hope that you will find this module useful and also if you have any problems or questions please let me know I will be more than happy to help you :)

My email: [email protected]

instagram-web-oauth's People

Contributors

venits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

emna-com 5l1v3r1

instagram-web-oauth's Issues

source code?

where is the source code?

you only provide the minified version

Sachchin Annamtesting

sadf asdf asdf saf asdf asdf asdf asdfasdfj klsadgfksgkjkj kjsfsa dfsdf sdaf sdf sadf rotating_card_thumb.jpg

Unexpected token err

Uncaught SyntaxError: Unexpected token _ in JSON at position 0
    at JSON.parse (<anonymous>)
    at _receiveMessage

I followed the directions using in the index.html which you can see on likes 15 and 32/33 respectively

https://github.com/jacsonding/Team_Mango/blob/master/index.html

I use this code in my analyzeInsta method

function analyzeInsta(){
	//  window.InstAuth.init("b6ac144383124f8eae6bd040340179e0");
	  window.InstAuth.startAuthFlow();
	var token = window.InstAuth.getAccessToken();
	console.log("Token is : " + token);
}

In the actual site the console.logs an error (You can view here)

http://jacsonding.github.io/Team_Mango

I believe the issue is in how the JSON response is handled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.