TdxOAuth2AuthorizationAgent Class
The base class for OAuth 2.0 authorization components.
Declaration
TdxOAuth2AuthorizationAgent = class abstract(TdxCustomAuthorizationAgent)
Remarks
An OAuth 2.0 DevExpress component allows you to authorize your app in a supported online account using the OAuth 2.0 authentication protocol.
Main API Members
The list below outlines key members of the TdxOAuth2AuthorizationAgent
component. These members allow you to authorize your app in an account on behalf of a user and manage access tokens.
Access Token Management
- AccessToken | AccessTokenExpiresIn
- Return the current access token and its expiration time (in seconds).
- AccessTokenType
- Returns the access token type.
- DefaultTokenExpiresIn
- Specifies the default life time for an access token, in seconds.
- DefaultRedirectUri | RedirectUri
Specify the address required to receive an access token.
Important
Use corresponding settings for different online service providers. Refer to the RedirectUri property description for detailed information.
- Load
Assigns specified access and refresh tokens.
Tip
This method is useful if you need to load existing tokens stored in the local file system.
- OnReceiveAccessToken | OnReceiveAuthorizationCode
- Allow you to override predefined authorization and authentication routines.
- RefreshAccessToken
- Refreshes the access token on demand using the refresh token.
- RefreshToken
- Returns the current refresh token.
- RevokeAccessToken
- Revokes the current access token. This operation also terminates the current authorization session.
- ValidateAccessToken
- Checks if the access token is valid and refreshes the token if it has expired.
Credentials Management
- ClientID
- Specifies a unique OAuth 2.0 client identifier.
- ClientSecret
Specifies the OAuth 2.0 secret for the identifier assigned to the ClientID property.
Important
We strongly recommend that you can handle the OnGetClientSecret event to request the client secret from a safe storage on demand.
- OnGetClientSecret
- Recommended. Allows you to load an OAuth 2.0 secret from a safe storage in response to starting an authorization session.
Server-Related Settings
- DefaultUserAgent | UserAgent
- Allow you to define a specific user agent for interaction with a cloud service.
- HeaderContentType
- Specifies the default header for HTTPS requests.
Permission Management
- AdditionalScopes
- Specify a set of permissions granted by a user to an application for all required operations in the target account.
- DefaultIncludeGrantedScopes
- Specifies if incremental authorization is active.
- RefreshScopes
- Reloads account access permissions.
Session Management
- FinishAuthorization
- Terminates the ongoing authorization session.
- IsAuthorized | OnStartAuthorization | OnFinishAuthorization
- Allow you to track the authorization session state.
- OnError
- Returns information on an authorization error every time it occurs.
- RestartAuthorization
- Restarts the current authorization session.
- StartAuthorization
- Starts a new authorization session using the current component settings.
Terminal TdxOAuth2AuthorizationAgent Class Descendants
Do not use the TdxOAuth2AuthorizationAgent
class directly. Use the following components instead:
- TdxGoogleAPIOAuth2AuthorizationAgent
- A non-visual component designed to authorize your application in a Google account.
- TdxMicrosoftGraphAPIOAuth2AuthorizationAgent
- A non-visual component designed to authorize your application in a Microsoft online account.