dbsync_srvapp.auto_register_user()
Enables automatic user/app creation for the DB Sync server-side app.
Syntax
FUNCTION auto_register_user(
app_id dbsync_core.t_app_id,
user_id dbsync_core.t_user_id,
user_name dbsync_core.t_user_name
)
- app_id defines the app id for the DB Sync server-side app; this is a string.
- user_id defines the user id; this is a string.
- user_name is the user description. If
NULL
, a default description is generated; this is a string.
Usage
Use this function to get user/app definition automatically created in the DB Sync system tables, if this user/app pair does not yet exist.
Enable user/app auto-registration ONLY if the user id is properly authenticated throught SSO or your own login/pswd system: There is no way for the DB Sync system to check the user id passed as parameter. When this function is called, the DB Sync system assumes that the provided user id is valid and verified.
The app_id parameter identifies the server-side application in the DB Sync system. This app_id is created with the DB Sync app definition console.
The user_id parameter identifies the end user which is using the current server-side app.
After using the auto_register_user() function, the server-side app should call the dbsync_srvapp.register_central_app_params()
function.
If you are not using GAS/SSO to authenticate server-side DB Sync users, the application must
identify the end user to get the user_id. For example, call the dbsync_core.enter_user_credentials()
function to ask the end user for a
login/password.
OIDC_SUB
environment
variable: LET user_id = fgl_getenv(“OIDC_SUB“)
For more details about server-side app and user setup, see Set up DB Sync for server-side apps.