Package org.vrspace.server.api
Class Oauth2Controller
- java.lang.Object
-
- org.vrspace.server.api.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 Summary
Constructors Constructor Description Oauth2Controller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
callback(String code, String state, javax.servlet.http.HttpServletRequest request)
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.
-
-
-
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:
-
-