lebronjamesuit / social-media-platforms

Build an backend app social media, secure my API using Spring Security 6 and Auth0. Deployed AWS.
https://lbconfessionapis-2012569758.eu-west-2.elb.amazonaws.com/swagger-ui/index.html
1 stars 0 forks source link

Oauth 2.0 confusions? #3

Open lebronjamesuit opened 1 year ago

lebronjamesuit commented 1 year ago

Pick a general flow that easy to implement. It is arguably the most popular one.

  1. So it starts with the Client sending a login request to the server.
  2. The server checks the credentials provided by the user, if the credentials are right, it creates a JSON Web Token (JWT).
  3. It responds with a success message (HTTP Status 200) and the JWT.
  4. The client uses this JWT in all the subsequent requests to the user, it provides this JWT as an Authorization header with Bearer authentication scheme.
  5. When the server, receives a request against a secured endpoint, it checks the JWT and validates whether the token is generated and signed by the server or not.
  6. If the validation is successful, the server responds accordingly to the client.