spring-guides / tut-spring-boot-oauth2

Spring Boot and OAuth2:: A tutorial on "social" login and single sign on with Facebook and Github

Home Page:https://spring.io/guides/tutorials/spring-boot-oauth2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a user in local database after successful social login

AttitudeL opened this issue · comments

Dear all,
I've been studying oauth2 for several days and now have a general idea about how oauth2 works. This tutorial is very helpful and I'm able to extend the social login beyond facebook and github.

However I now have some questions regarding creating new local user after successful social login say from facebook. I want to create a new user or updating the existing user's last login date right after successful login from facebook. I struggled a lot of not knowing the right place to do this.

From the guide I saw that you can create your own local user from the "/user" endpoint. I'm not sure this is the right place for me to do the above mentioned works. The thing is that after a user chose to login with facebook but the "/user" endpoint is never invoked, then there would not be a new user created in my local database.