Code Monkey home page Code Monkey logo

spring-boot-facebook-oauth's Introduction

Facebook OAuth Login Example

Spring-boot demo for facebook oauth login. Reference by facebook manually-build-a-login-flow.

Step1. Generate facebook oauth login url

The REST resource of /api/facebook/user/login will be generate a facebook oauth login url, you can pass with perms parameter, perms means facebook login permissions, can ref facebook permissions,

curl -XGET "http://localhost:8888/api/facebook/user/login?perms=public_profile,email,friends"

Step2. Setting facebook app for oauth redirect uri

when client click the oauth login url, facebook will send a request to /api/facebook/oauth/callback, you must be setting Valid OAuth redirect URIs on your facebook app dashboard. alt app-dashboard

Step3. Handle facebook oauth login callback

The REST resource of /api/facebook/oauth/callback will handle the facebook callback, You must implement verify state parameter to defend dangerous request. then pass code parameter to request facebook user's access_token, ref by Exchanging Code for an Access Token

enjoy

English is not my native language; I try my best.

spring-boot-facebook-oauth's People

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.