Class SketchfabController

  • @RestController
    public class SketchfabController
    extends Object
    • Constructor Detail

      • SketchfabController

        public SketchfabController()
    • Method Detail

      • 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

        public org.springframework.http.ResponseEntity<String> callback​(String code)
        Sketchfab oauth2 callback, as explained in Uses code provided by client to authorise at sketchfab, and returns 302 redirect to the saved referrer.
        code - provided to the client by sketchfab
      • download

        public org.springframework.http.ResponseEntity<GltfModel> download​(String uid,
                                                                           javax.servlet.http.HttpServletRequest request)
        Sketchfab download, as explained in 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.
        uid - unique id of the model
        request - original request, referrer is saved for later use in case the authentication fails