Class AuthenticationController

java.lang.Object
com.se21.calbot.controllers.AuthenticationController

@RestController @CrossOrigin(origins="*") public class AuthenticationController extends Object
This class serves as routing path controller. Any call to application/{route} will be handled here. For this project we need to expose one endpoint for Google Oauth 2.0 to share auth code. So that is being handled by this class.
  • Field Details

  • Constructor Details

    • AuthenticationController

      public AuthenticationController()
  • Method Details

    • token

      @RequestMapping(value="/test", method=GET) public String token(@RequestParam String code, @RequestParam String state)
      This function will be executed whenever a call is made to https://{application endpoint}/test It is responsible to extract auth token and user id from url parameters and save it in the db for future use.
      Parameters:
      code - auth code
      state - userId
      Returns:
      Msg for user
    • authenticateTest

      @RequestMapping(value="/generate", method=GET) public String authenticateTest()
      Test endpoints, feel free to use them during development
      Throws:
      Exception
    • summary

      @RequestMapping(value="/retrieve", method=GET) public void summary() throws Exception
      Test endpoints, feel free to use them during development
      Throws:
      Exception