Creating a Custom OAuth Application
Creating a Custom OAuth Application
CData embeds OAuth Application Credentials with CData branding that can be used when connecting to Sage Business Cloud Accounting via a desktop application or a headless machine. If you want to use the embedded OAuth application from either of those two auth flows, all you need to do to connect is to:- set AuthScheme to OAuth,
- get and set the OAuthAccessToken, and
- set the necessary configuration parameters.
(For information on getting and setting the OAuthAccessToken and other configuration parameters, see "Connecting to Sage Business Cloud Accounting".)
However, you must create a custom OAuth application to connect to Sage Business Cloud Accounting via the Web. And since custom OAuth applications seamlessly support all three commonly-used auth flows, you might want to create custom OAuth applications (use your own OAuth Application Credentials) for those auth flows anyway.
Custom OAuth applications are useful if you want to:
- control branding of the authentication dialog;
- control the redirect URI that the application redirects the user to after the user authenticates; or
- customize the permissions that you are requesting from the user.
Procedure
The following steps create a custom OAuth application, registers it in the Sage Business Cloud Accounting Developer account, and obtains the OAuth client credentials:- Log into the Sage Business Cloud Accounting Developer Account.
- Create a new application.
- If you are developing a desktop application, set the CallbackUrl to http://localhost:3333, or some other similar http url.
- If you are developing a web service, set the CallbackUrl to the redirect uri you would like your web service to receive.
When your custom application has been created, the Developer portal displays the OAuthClientId (Client Id) and OAuthClientSecret (Client Secret). Record these for future use.