Authenticating when invoking a private function via HTTPS
Written by
Updated at February 28, 2024
To invoke a private function via HTTPS, you must authenticate. To do this, get:
-
Specify the obtained IAM token in the
Authorization
header in the following format:Authorization: Bearer <IAM_token>
IAM tokens are valid for up to 12 hours.
-
API key for the service account.
Specify the obtained API key in the
Authorization
header in the following format:Authorization: Api-Key <API_key>
API keys do not expire. This means that this authentication method is simpler, but less secure. Use it if you cannot request an IAM token automatically.