Class DropboxAuthorizationController
java.lang.Object
org.apache.clusterbr.zupportl5.controller.DropboxAuthorizationController
@RestController
@RequestMapping("/api/dropbox")
public class DropboxAuthorizationController
extends Object
REST-API Endpoints --
- GET /api/dropbox/start-auth: Initiates Dropbox OAuth-2 authorization-flow by generating and returning the authorization URL.
- GET /api/dropbox/oauth2/callback: Handles the authorization callback, retrieves the refresh token, and stores it securely.
Implementing the OAUTH-2 AUTHORIZATION-FLOW as required by Dropbox
- ADMIN user triggers the authorization process by visiting /api/dropbox/start-auth.
- The ADMIN is redirected to Dropbox's authorization page, to log-in, once logged-in the Authorization workflow continues the next-step.
- Dropbox sends the CODE to the following endpoint of the APP: /api/dropbox/oauth2/callback; the callback(code) function receives the CODE sent by Dropbox.
- Then the application exchanges the CODE with the Dropbox-api requesting for-a FRESH-TOKEN. The APP saves the FRESH-TOKEN securely.
- Then the application exchanges the CODE with the Dropbox-api requesting for-a FRESH-TOKEN. The APP saves the FRESH-TOKEN.
REFRESH-TOKEN Explained
- Purpose: Used to obtain a new access token when the current one expires.
- Scope: Tied to the same permissions granted during initial authentication.
- Lifespan: Long-lived (can last days, months, or indefinitely depending on the provider).
- Does Not Expire Quickly: It stays valid as long as the user hasn’t revoked the authorization.
ACCESS-TOKEN Explained
- Purpose: Grants temporary access to a specific API or resource.
- Scope: Limited to the permissions granted during authentication (e.g., read/write files).
- Lifespan: Short-lived (usually minutes to hours).
- Expires Quickly: Requires renewal after expiration.
Dropbox OAuth Guide
UML Diagrams:




- Since:
- 2024-1108
- Author:
- arcbrth@gmail.com
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DropboxAuthorizationController
-
-
Method Details
-
startAuthorization
@GetMapping("/start-auth") public org.springframework.http.ResponseEntity<String> startAuthorization()Entry end-point to initiate the Dropbox Authorization.
https://server:port/api/dropbox/oauth2/callback
https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize
-
handleCallback
-