Constructs an instance of this controller.
This method executes a basic HTTP handler that uses axios
under the
hood, to execute a HTTP request to a remote data provider API. This
method can be used to request specific endpoints from the providers
API, e.g. /activities/:id
from Strava.
Note that the access token attached to the request as an Authorization
header (Bearer), is the one from the integration
parameter. This permits
to execute requests using the account's valid OAuth authorization.
Note that you do not need to add an access token header in the options
parameters, it will be added automatically whenever you use this method.
The endpoint URI that must be requested from the remote data provider API.
The accountintegrations
entity that will be updated.
A response object that contains a status
, code
and response
as defined in ResponseStatusDTO.
This method determines and creates an OAuth driver from the inputs' provider name and config and returns a OAuthDriver object.
Contains the identifier of the OAuth Provider, e.g. "strava".
The OAuth provider parameters, i.e. URLs and configuration.
The created driver instance.
Method to extract and transform an entity as described by the data
provider API. Typically, this method is used to handle transformations
of remote objects (from data provider API) to internal objects in
the backend runtime's database.
e.g. This method is used to transform activity data as defined
by the Strava API, into ActivityData as defined internally.
Contains the identifier of the OAuth Provider, e.g. "strava".
The API Response object that will be transformed.
(Optional) The type of entity as described in OAuthEntityType.
A parsed entity object.
Method to returns the remote authorization URL to link accounts e.g. "Strava OAuth URL".
Contains the identifier of the OAuth Provider, e.g. "strava".
The Address of the user account on dHealth Network.
The provided referral code.
The remote authorization URL to link accounts.
Generate an encryption password (seed) to protect the access token using a combination of the authentication secret, the user address and Strava-owned authentication details.
The document of OAuth integration.
The remote identifier of the end-user (remote as in "from Strava").
The generated encryption seed.
Method to find one AccountIntegrationDocument from the database by querying with provider name and remote identifier.
Contains the identifier of the OAuth Provider, e.g. "strava".
The address to query account integration document from.
The result account integration document.
Method to find one AccountIntegrationDocument from the database by querying with provider name and remote identifier.
Contains the identifier of the OAuth Provider, e.g. "strava".
The remoteIdentifier to query account integration document from.
The result account integration document.
Method to find AccountIntegrationDocument from the database by querying with fields of an AccountDocument.
The account document to query the corresponding integration document from the database.
The paginated result of the account integration documents.
This method reads an OAuth provider configuration
from the runtime configuration file config/oauth.ts
and returns a OAuthProviderParameters object.
Contains the identifier of the OAuth Provider, e.g. "strava".
The OAuth provider parameters, i.e. URLs and configuration.
This method sends an OAuth callback request to the provider and
stores the integration result's details in database.
Note that this process includes requesting an access/refresh token
from the provider and creating an encryption password that will be
used to sign the access/refresh tokens pair.
Contains the identifier of the OAuth Provider, e.g. "strava".
The account document to be integrated with access/refresh tokens.
The OAuth callback request.
The result account integration document that has been saved.
This method sends an OAuth access token refresh request to the provider
and stores the integration result's details in database.
Note that this process includes requesting an access/refresh token
from the provider and creating an encryption password that will be
used to sign the access/refresh tokens pair.
Contains the identifier of the OAuth Provider, e.g. "strava".
The accountintegrations
entity that will be updated.
The resulting account integration document that has been saved.
Method to update the AccountIntegrationDocument in database.
Contains the identifier of the OAuth Provider, e.g. "strava".
The update data content to be applied.
The updated account integration document.
Generated using TypeDoc
This class contains methods for connecting, linking accounts to the providers usage example can be found in OAuthController
v0.2.0