Spring-boot demo for facebook oauth login. Reference by facebook manually-build-a-login-flow.
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"
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.
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
English is not my native language; I try my best.