0

I am new Spring Core and Spring Security as well, but currently I am solving task where I have to implement authentication over JWT.

I do some research and I fount 2 solutions.

  1. Make authentication with Spring Security, with OAuth2 module
  2. Second option is using JJWT library. The majority of guides which I found were with JJWT.

Can you tell me what is better to use and why? Thanks.

Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174

1 Answers1

1

Check out the answer of this it will help you. JWT vs OAuth authentication You can use OAuth2 with JWT together.

joel
  • 93
  • 2
  • 12
  • So if I am right, If I need provide authentication for another applications, something like google or fb do, then go with OAuth2, and if I just need authentication for my app using JJWT is enough? – Denis Stephanov Jan 30 '18 at 13:56
  • @DenisStephanov Yes. If your not building your own Authentication you can use google or fb authentication and you just need to send the Access-token on header of your request. If you looking for login with google or fb spring has a project called spring-social. https://www.petrikainulainen.net/spring-social-tutorial/ – joel Jan 30 '18 at 14:33