Retrieve an Oauth URL

Retrieving an OAuth URL

Overview

The getOauthUrl method in the b.well SDK is designed to retrieve an OAuth URL for a specific data source, facilitating the OAuth authentication flow for that connection.

Method Signature

suspend fun getOauthUrl(datasourceId: String): BWellResult<Any>
  • datasourceId: The unique identifier of the datasource for which the OAuth URL is needed.
  • BWellResult<Any>: Returns a string containing the absolute URL to initiate the OAuth flow.

Obtaining the OAuth URL

  1. Provide Datasource ID:

    • Specify the datasourceId corresponding to the connection for which the OAuth flow is to be initiated.
  2. Retrieve URL:

    • The method returns an absolute URL that can be used by the client to start the OAuth authentication process with the specified datasource.

Best Practices

  • Validating Datasource ID: Ensure the provided datasourceId is correct and corresponds to an existing datasource.
  • Secure Handling: Treat the retrieved OAuth URL with caution, as it is integral to the security of the authentication process.