[Pub/Sub]: add sample for decoding and verifying JWT from Pub/Sub #1243
Labels
api: pubsub
Issues related to the Pub/Sub API.
samples
Issues that are directly related to samples.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Please add a sample in this directory and show how to decode and verify a JWT included in the header of a Pub/Sub push message (when authenticated push is enabled). The other language (Go, Node.js, Java, Python) samples already exist. This sample will be used alongside those.
I'm not sure if PHP has a cloud client library for this task (please find out if you can), but it appears to have an API client library
google-api-php-client
that does the job, specifically, theverifyIdToken()
method.You can use Google's public keys referenced here to verify JWTs from the real Pub/Sub service. For writing tests, you can use mocked public keys in other language samples.
You can use the region tag
gaeflex_net_pubsub_auth_push
for this sample.The text was updated successfully, but these errors were encountered: