- Notifications
You must be signed in to change notification settings - Fork704
Spring Boot React OAuth2 Social Login with Google, Facebook, and Github
callicoder/spring-boot-react-oauth2-social-login-demo
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Create MySQL database
mysql> create database spring_socialConfigure database username and password
# spring-social/src/main/resources/application.ymlspring:datasource:url:jdbc:mysql://localhost:3306/spring_social?useSSL=falseusername:<YOUR_DB_USERNAME>password:<YOUR_DB_PASSWORD>
Specify OAuth2 Provider ClientId's and ClientSecrets
This is optional if you're testing the app in localhost. A demo clientId and clientSecret is already specified.
security:oauth2:client:registration:google:clientId:<GOOGLE_CLIENT_ID>clientSecret:<GOOGLE_CLIENT_SECRET>redirectUriTemplate:"{baseUrl}/oauth2/callback/{registrationId}"scope: -email -profilefacebook:clientId:<FACEBOOK_CLIENT_ID>clientSecret:<FACEBOOK_CLIENT_SECRET>redirectUriTemplate:"{baseUrl}/oauth2/callback/{registrationId}"scope: -email -public_profilegithub:clientId:<GITHUB_CLIENT_ID>clientSecret:<GITHUB_CLIENT_SECRET>redirectUriTemplate:"{baseUrl}/oauth2/callback/{registrationId}"scope: -user:email -read:userprovider:facebook:authorizationUri:https://www.facebook.com/v3.0/dialog/oauthtokenUri:https://graph.facebook.com/v3.0/oauth/access_tokenuserInfoUri:https://graph.facebook.com/v3.0/me?fields=id,first_name,middle_name,last_name,name,email,verified,is_verified,picture.width(250).height(250)
Please make sure that
http://localhost:8080/oauth2/callback/<provider>is added as an authorized redirect uri in the OAuth2 provider. For example, In yourGoogle API console, make sure thathttp://localhost:8080/oauth2/callback/googleis added in theAuthorized redirect URIsAlso, make sure that the above mentioned scopes are added in the OAuth2 provider console.For example, scope
emailandprofileshould be added in your Google project's OAuth2 consent screen.Run spring-social
mvn spring-boot:run
cd react-socialnpm install&& npm start
About
Spring Boot React OAuth2 Social Login with Google, Facebook, and Github
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
