Skip to content

Spring Boot application that uses OAuth2.0 for login with github

Notifications You must be signed in to change notification settings

khadkakrishna/spring-boot-oauth-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-oauth-app

Prerequisites:

  1. generate google-oauth client-id and client-secret
  2. generate github-oauth client-id and client-secret

Note: After generating the above tokens place it in src/main/resources/application.properties

About the application:

  • The starting point of the application is src/main/java/com/development/SpringOAuthApplication/SpringOAuthApplication.java that runs the spring boot application.
  • There is one rest-controller defined in src/main/java/com/development/SpringOAuthApplication/controller/Controller.java that lands to the http://localhost:8080/ and prints Hello.
  • The configuration for authentications are defined in src/main/java/com/development/SpringOAuthApplication/config/WebSecurityConfig.java for the OAuth2 login as well as Form Based login.
  • The UserDetailsService is defined in src/main/java/com/development/SpringOAuthApplication/config/WebSecurityConfig.java that adds the user for the login with username:user and password:password.

Running the application:

To run the application, type mvn spring-boot:run on terminal

The application will be accessible at http://localhost:8080 and redirected to the login page at http://localhost:8080/login

Note: To run the application in debug mode add debug=true in src/main/resources/application.properties

About

Spring Boot application that uses OAuth2.0 for login with github

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages