- Categories:
System functions (System Information)
SYSTEM$GET_ SERVICE_ CALLER_ TOKEN_ EXPIRY¶
Returns the expiration timestamp of a caller’s rights login token for a Snowpark Container Services service.
- See also:
Syntax¶
Arguments¶
Required:
token_stringThe caller’s rights login token string, obtained from the
Sf-Context-Current-User-TokenHTTP header that Snowflake passes to the service container.
Returns¶
Returns a timestamp string representing the expiration time of the token (for example, 2026-07-18T14:30:00Z).
Usage notes¶
- This function can be called by the service application to determine when the caller token will expire.
- The token is obtained from the
Sf-Context-Current-User-Tokenheader that Snowflake provides to the container when a user accesses a service with caller’s rights (executeAsCaller: true). - Use this function to implement token refresh logic in long-running services.
Examples¶
The following statement checks the expiration time of a caller token:
Example output: