I am creating new product. for that I have to use available security features. should I use Oauth2
or Json web token
? which is better and in which situation these should be used?
-
Some people are down voting the question. if you cant answer just ignore. why are you down voting? what will you get? – Apr 12 '20 at 16:04
-
1what do you actually require? Do you need to set up auth server as well or simply use any auth services like the one google provides? Can you be more specific? – Nithin Apr 15 '20 at 08:31
-
I want to setup auth server Nithin. – Apr 15 '20 at 14:28
2 Answers
I think you may find your answer in using org.apache.oltu.oauth2. https://www.programcreek.com/java-api-examples/?api=org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder

- 1
- 2
You can see an implementation for oauth and openID here oauth server and resource server
Just to explain what they are,
oauth server
creates the tokens
resource server
uses that token and processes it to give you the requested data
You can also go through the following docs to understand what they mean and how to implement them, sample implementation in java , oracle tutorial on the concept of tokens
If you want to do google API auth then you can go through this
I also found this stackoverflow link which is sort of similar question and has shared few of similar links. You should check that out as well.

- 683
- 3
- 11