Java Spring Boot OAuth2 Social with PKCE and JWT authentication project set up

Job ID: 31440048

Budget: $10 – $30 USD

I need a Java Spring OAuth2 Social media login and JWT starter project that secures a REST API. It must do the following:

1. There needs to be a /login end point that will let a user login using their Google account (Only Google login is required) using the "Authorization code flow" WITH PKCE of OAuth2.

NOTE: The user will not send their emailid or password to our server. For any unauthenticated request to our server, the server will send a redirect url to the client that contains client id, profile fields, and a redirect url. Please MAKE SURE THAT YOU UNDERSTAND how OAuth2 - Authorization code flow works.

After authentication with google is successful, if the user is not in the database already, a new row will be created in the USER table with fields - emailid and name as returned by google using the AuthCode/Auth Token. If the user row was already created in the table previously, nothing is done in this step.

2. The /login end point will return a JWT token. This token will also be saved in the user table in column named JWT (in the row associated with that user).

3. There needs to be a /data end point that is accessible only if Authentication: Bearer <JWT> header is present in the request. It will return some random data associated with that user (not important). The JWT token must be the same as the one that was returned by the /login end point.

That's it. I need the project structured in Maven format and latest spring boot version and Spring Boot Starter Parent ver 2.5.4. Use Eclipse IDE. MySql db.

Must be stateless. No HttpSession should be used. No Cookies. The above backed will be tested using Postman/SOAPUI.

End points:
1. GET /login : saves/creates a user in the user table, returns a JWT token
2. GET /data : authenticated using the same JWT token returned previously. Header must contains Authorziation: Bearer <JWT> : returns some random data.