Coder Social home page Coder Social logo

dineschandgr / spring-security-oauth2-facebook Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 162 KB

oauth2 authorization code flow using Facebook as Authorization and Resource server

Java 77.72% HTML 22.28%
oauth2 authorization-server resource-server authorization-code-grant facebook facebook-developers postman

spring-security-oauth2-facebook's Introduction

spring-security-OAuth2-Facebook

oauth2 authorization code flow using Facebook as Authorization and Resource server

  1. Create an App using Facebook for developers
  2. Obtain the Client ID and Client Secret provided by facebook
  3. Download pom.xml to download all required dependenices (only annotation required is @EnableOAuth2Sso)
  4. Make a request to http://localhost:8080
  5. The application will redirect the user to the userAuthorizationUri: https://www.facebook.com/dialog/oauth
  6. Once facebook verifies the client from the client Id and client secret, it redirects the user to facebook login form
  7. Once user enters user id and password, facebook will authenticate the user and provides the authorization code to the client
  8. The Client now will provide the authorization code to the url accessTokenUri: https://graph.facebook.com/oauth/access_token to obtain the access token
  9. Now the client uses the access token to the facebook resource server to request the user data from facebook
  10. Here facebook is both the Authorization and Resource server. In some cases, both the servers can be separate entities

Similarly, the client app can be created in many platforms like Github, Google, Okta etc and the respective client id and client secret along with respective urls should be used in the property file

API Architecture

You can also get the access token from postman app. use postman console or the chrome developer tools Network tab to check the request and response header/body

spring-security-oauth2-facebook's People

Contributors

dineschandgr avatar

Watchers

 avatar  avatar

Forkers

bonusjoker

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.