Class SketchfabController


  • @RestController
    @RequestMapping("/sketchfab")
    public class SketchfabController
    extends Object
    • Constructor Detail

      • SketchfabController

        public SketchfabController()
    • Method Detail

      • login

        @GetMapping("/login")
        public SketchfabController.LoginResponse login​(javax.servlet.http.HttpServletRequest request)
        Start of the login sequence. Returns the sketchfab login url, containing client id and redirect url. Client is then expected to open that url and authorise there. Saves the referrer for later use in callback.
      • callback

        @GetMapping("/oauth2")
        public org.springframework.http.ResponseEntity<String> callback​(String code)
        Sketchfab oauth2 callback, as explained in https://sketchfab.com/developers/oauth#implement-auth-code Uses code provided by client to authorise at sketchfab, and returns 302 redirect to the saved referrer.
        Parameters:
        code - provided to the client by sketchfab
        Returns:
      • download

        @GetMapping("/download")
        public org.springframework.http.ResponseEntity<GltfModel> download​(String uid,
                                                                           javax.servlet.http.HttpServletRequest request)
        Sketchfab download, as explained in https://sketchfab.com/developers/download-api/downloading-models Requires successful authentication, returns 401 unauthorised unless the server is authorised with sketchfab (token exists). In that case, client is expected to attempt to login.
        Parameters:
        uid - unique id of the model
        request - original request, referrer is saved for later use in case the authentication fails
        Returns: