React and Spring boot - facebook authentication

(Zmaslem) #1

i’m starting a project using spring boot on backend, and react.js on front. The task I’m working on is handling the account creation, particularly authenticating using facebook/google etc. After successful logging I want to redirect to some next step in account creation. I have few approach to consider, don’t know which one would work best in given scenario and tech stack.

  1. Handling the social logon on back site with spring boot. But then how can I redirect to next step which is on react side (after successful logging)? How can I pass the direct url to which I would like to go? It’s not in the spring app range, isn’t it?

Wouldn’t it be better to 2) Handle the social logon using react, get the data I need and send it to back for persisting into db and keeping the session and proceed on the front to next step?

I don’t know which approach to go with. Guys, do you have any suggestions or examples I could analyse? Maybe I’m completely wrong with my thinking…

(Leandro Siqueira) #2

Take a look at this example, it uses Twitter and React, but spring-social supports Facebook too.