Getting started with TMS FNC Cloud Microsoft OneDrive
Prerequisites
- TMS FNC Core installed and the runtime package added to the project.
- TMS FNC Cloud Pack installed.
- An app registered in the Microsoft Entra admin center with a client ID, client secret, and a registered redirect URI.
Add the component
- Drop
TTMSFNCCloudMicrosoftOneDriveonto a form (or create it in code). - Set the app credentials on
Authentication(client ID, secret, redirect URI). - Call
Connectto authenticate, then call OneDrive operations fromOnConnected.
Minimal example
Set the credentials, connect, and request the account info once connected:
procedure TForm1.FormCreate(Sender: TObject);
begin
// Credentials from your app registration (https://portal.azure.com).
TMSFNCCloudMicrosoftOneDrive1.Authentication.ClientID := 'your-client-id';
TMSFNCCloudMicrosoftOneDrive1.Authentication.Secret := 'your-client-secret';
// Must match a redirect URI registered on the app.
TMSFNCCloudMicrosoftOneDrive1.Authentication.CallBackURL := 'http://127.0.0.1:8000';
TMSFNCCloudMicrosoftOneDrive1.OnConnected := OneDriveConnected;
// Opens the Microsoft consent page in the browser and exchanges the code for tokens.
TMSFNCCloudMicrosoftOneDrive1.Connect;
end;
procedure TForm1.OneDriveConnected(Sender: TObject);
begin
// Tokens (including a refresh token) are now available on Authentication.
TMSFNCCloudMicrosoftOneDrive1.GetAccountInfo;
end;
Next steps
- Authentication — credentials, the OAuth flow, and persisting tokens
- Folder and file operations — listing, resolving by ID, creating, moving, renaming and deleting
- Search and sharing — searching the account and requesting share links
- Uploading — transferring file content
- API reference — full class reference