Class Oauth2Controller


  • @RestController
    @RequestMapping("/oauth2")
    public class Oauth2Controller
    extends Object
    Oauth2 login is completely handled by spring security, this is just callback once it's all done. Client's identity is something like joe:facebook, but hashed. Login name must match the stored identity.
    Author:
    joe
    • Constructor Detail

      • Oauth2Controller

        public Oauth2Controller()
    • Method Detail

      • login

        @GetMapping("/login")
        public org.springframework.http.ResponseEntity<String> login​(String name,
                                                                     javax.servlet.http.HttpSession session,
                                                                     javax.servlet.http.HttpServletRequest request)
        After successful Oauth2 login with external provider (fb, github, google...), fetch/create the Client object, and redirect back to the referring page.
        Parameters:
        name -
        session -
        request -
        Returns:
      • callback

        @GetMapping("/callback")
        public void callback​(String code,
                             String state,
                             javax.servlet.http.HttpServletRequest request)