Register sync source parameters

Configure and register DB Sync source parameters by defining and loading a source record from a configuration file, then register the source parameters.

Define a config file with source info and use the dbsync_core.read_dbsync_source_file() to load the info into a dbsync_core.t_dbsync_source record, or fill the source record with connection info:
  DEFINE dbsync_source dbsync_core.t_dbsync_source
  IF dbsync_core.read_dbsync_source_file(filename, dbsync_source) < 0 THEN
     DISPLAY "ERROR: Failed to read JSON DB Sync source config file"
     EXIT PROGRAM 1
  END IF

When using GAS/SSO(/GIP), the current user will be identified by the OAuthAPI process: No user registration call is required with dbsync_app.register_dbsync_user().

The dbsync_source structure must contain the SSO parameters as in following example:
 dbsync_source.sso.idp_issuer = "http://toro:6394/ws/r/services/GeneroIdentityProvider"
 dbsync_source.sso.client_id     = "640F0E5E-..."
 dbsync_source.sso.client_secret = "ulBf..."

The parameters of the dbsync_source record can be provided in a DB Sync client app configuration file and loaded with the dbsync_core.read_dbsync_source_file() function.

Important:

Make sure to not expose the client secret: Consider to encrypt the client secret stored in the JSON configuration file (or hardcoded in your app code), and decrypt the secret before calling the registration function.

Register the DB Sync source parameters with dbsync_app.register_dbsync_source():
  CALL dbsync_app.register_dbsync_source(dbsync_source)