Coder Social home page Coder Social logo

instaoauth's Introduction

instaOAuth

instaOAuth experiment by elzakaria

Little sample to showcase how you can use the OAuth protocol against the instagram API :

1 - Redirect the user to authorize us by Instagram and send the authorization code to redirect_uri

2 - /redirect_uri endpoint receives the authorization code and ask for the access token that we store as a cookie so we dont have to authenticate the user everytime.

3 - /hello endpoint hits the instagram api endpoint /users/self to retrieve information about the profile and shows bio and pseudo.

Configuration :

You have to replace in the file with you own values, better put the on your maven user settings files so you don't change the file itself while MVN building.

prop_client_id=${client_id}
prop_client_secret=${client_secret}
prop_grant_type=${grant_type}
prop_redirect_uri=${redirect_uri}

${client_id} : your registered client id in Instagram
${client_secret} : your client secret
${grant_type} : always authorization_code
{redirect_uri} : always http://yourapp.com/redirect_uri that you put on your instagram api configuration redirect uri.

Sample :
prop_client_id=JK848FJ4HR4848R4Z
prop_client_secret=LK93020202KDJEJFJ
prop_grant_type=authorization_code
prop_redirect_uri=http://localhost:9999/instaOAuth/redirect_uri

Main Dependencies :

  • HttpClient to make Http request to the instagram api.

  • Spring MVC to have our request and views.

  • GSON to parse IG's JSON results into javabean objects.

instaoauth's People

Contributors

zakariahere avatar bzakaria avatar dependabot[bot] avatar

Watchers

 avatar

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.