Overview
Oauth2 tokens have an expiration period, so a scheduled task is used to periodically refresh them. The rest.oauth2_credential_refresh_interval parameter specifies the execution interval for this scheduled task.
Privilege requirements
Query parameters
Both the
systenant and all user tenants can query this parameter using theSHOW PARAMETERSstatement or theGV$OB_PARAMETERSview.Modify parameters
Both the
systenant and user tenants can modify this parameter.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Time |
| Default Value | 10 Minutes |
| Value range | [1s, 1d] |
| Modifiable | Yes, you can use theALTER SYSTEM SETStatement modification. |
| Whether to restart the OBServer node for the change to take effect | Yes, it takes effect after a restart. |
Usage instructions
Sets the periodic refresh interval for the OAuth2 cache. Setting an appropriate value based on your token's expiration time can reduce cache invalidation. Reduce this value when the token has a short validity period, and increase it otherwise. It is recommended to set it to (1/3 to 1/6) of the OAuth2 token's validity period. Supported units are microseconds (us), milliseconds (ms), seconds (s), minutes (m), hours (h), and days (d). The default is seconds.
Configuration example
Set the regular refresh interval for the OAuth2 cache to 30 minutes.
obclient> ALTER SYSTEM SET rest_oauth2_credential_refresh_interval = "30m";