vcl-154015-expresscrossplatformlibrary-concepts-authorization-agents-and-data-providers.md
Authorization agents are non-visual components that identify your application to an online account and perform all necessary authentication and authorization operations on behalf of an end-user. Each authorization agent component is designed to work together with one or more data providers that implement resource access and management routines specific for a target online service type. There are data providers implemented as parts of the DevExpress products that support online data access and synchronization and independent user information providers that can only retrieve the user display name and e-mail from supported online service accounts.
Call the TdxAuthorizationAgentUser.GetUserInfo class function passing the required authorization agent component as a parameter to create an independent user information provider. The function automatically creates a compatible data provider and associates it with the specified authorization agent.
All DevExpress controls and components that support interaction with online services, use one active data provider at a time to access and synchronize resources with an account of the online service it supports. Each DevExpress product with the online data synchronization functionality automatically creates the provider you select via the dedicated ProviderClass or ProviderClassName property. Then you can use the AuthorizationAgent property to associate the provider with the compatible authorization agent.
|
Product
|
Data Provider-Related Properties
| | --- | --- | |
|
Select the active provider for an individual web service storage resource (calendar) via its ProviderClassName or ProviderClass property.
Access and configure the newly created provider via the calendar’s Provider property.
Use the online event provider‘s AuthorizationAgent property to associate it with the compatible authorization agent component.
| |
Cloud Storage Component
|
Select the active provider via the component’s ProviderClassName or ProviderClass property.
Access and configure the newly created provider via the Provider property.
Use the cloud storage data provider‘s AuthorizationAgent property to associate it with the compatible authorization agent component.
|
The following table lists account types supported by OAuth 2.0-compatible authorization agents and the corresponding data providers:
| |
Supported Online Service Type
|
Authorization Agent Component
|
Compatible Data Providers
| | --- | --- | --- | --- | |
|
|
TdxGoogleAPIOAuth2AuthorizationAgent
|
TdxGoogleAPIOAuth2AuthorizationAgentUserInfo
An independent user information provider that can obtain user display name and e-mail from a connected Google account.
| |
TcxSchedulerWebServiceStorageGoogleProvider
The Google API-compatible event data provider designed to read and manage user events for the online persistence manager in the ExpressScheduler Suite.
| |
TdxCloudStorageGoogleDriveProvider
The Google API-compatible data provider designed to access and synchronize files stored on a Google Drive server. Use this provider with the TdxCloudStorage component.
| |
|
Microsoft
|
TdxMicrosoftGraphAPIOAuth2AuthorizationAgent
|
TdxMicrosoftGraphAPIOAuth2AuthorizationAgentUserInfo
An independent user information provider that can obtain user display name and e-mail from a connected Microsoft account.
| |
TcxSchedulerWebServiceStorageOfficeProvider
The Microsoft Graph® API-compatible event data provider designed to read and manage user events for the online persistence manager in the ExpressScheduler Suite.
| |
TdxCloudStorageMicrosoftOneDriveProvider
The Microsoft Graph® API-compatible event data provider designed to access and synchronize files stored on a Microsoft OneDrive® server. Use this provider with the TdxCloudStorage component.
|
To configure an OAuth 2.0-compatible authorization agent component associated with an online data provider, you need to:
| Online Data Access API | How to Register a Native Application |
|---|---|
| Google API | https://developers.google.com/identity/protocols/oauth2?hl=en |
| Microsoft Graph® API | https://docs.microsoft.com/en-us/graph/auth-register-app-v2 |
Assign the URI required to receive an OAuth 2.0 account access token to the RedirectUri property. Refer to the property description for detailed information on specific settings for all supported online service providers.
Use the UserAgent property to specify how your application identifies itself to an OAuth 2.0 server on authorization.
Handle the OnError event to receive and process information on any authorization and authentication errors.
Then, you can attempt to connect your application to the target online account by setting the corresponding Connect property to True :
| Product | Connection Session Management Property |
|---|---|
| ExpressScheduler Suite | The event data provider‘s Connected property. |
| Cloud Storage Component | The component’s Connected property. |