Skip to content

Authentication with Google and GitHub using OAuth2.0

Notifications You must be signed in to change notification settings

DevDario/spring-oauth20

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Desafio

Authentication Logic with OAuth 2.0 with Google and GitHub

See this video by Telusko #39 Spring Security | Google and Github Login using OAuth2

Important 🚨

For you to be able to fork and use this project you'll need to have you own credentials from
both GitHub and Google Cloud.

You can get them here: GitHub & Google Cloud Console

For both options you'll have to create or select an existing project of yours !

How to Run

  • First you need to clone this to your machine
  git clone https://github.com/DevDario/spring-oauth20
  • Then access it
  cd spring-oauth20/
  • Now you can build the project:
$ ./mvnw clean package
  • and then run it:
$ java -jar target/SpringOauth2-0.0.1-SNAPSHOT.jar

You can access the API here: localhost:8080.

You will be redirected to the login form provided by OAuth2.0 if not authenticated

After you log in you can access the private route: localhost:8080/private.

Routes

localhost:8080 (home)

home page

localhost:8080/login (login options)

login page

with GitHub

it says "Costs" because I'll use it on another project of mine login with github

with Google

login with google

localhost:8080/private (secured route, accessed only by authenticated 'entity's')

secured route page