Can Google Cloud Functions use HTTPS client authentication?
Asked Answered
K

0

10

Can I use HTTPS client certificate authentication with HTTPS-triggered Google Cloud Functions?

I stand-alone node.js, I would try something like this:

var https = require('https'); 
var options = {requestCert: true, rejectUnauthorized: true}; 
https.createServer(options, function (req, res) { 
  // ...
}).listen(1234);

But since Google Cloud Functions (presumably) controls the creation of the node.js server, it is currently unclear to me how I could pass the required options.

Google offers documentation on how to use (OAuth 2.0) service accounts and access tokens for authentication, but I am interested in HTTPS client certificates, such as a web browser could also present.

Kalila answered 31/12, 2017 at 14:15 Comment(4)
There's nothing to indicate this is possible on Google's Cloud Function documentation page for the execution environment: cloud.google.com/functions/docs/concepts/exec This might be helpful for confirming: "Cloud Functions uses a Debian-based execution environment and includes contents of the gcr.io/google-appengine/nodejs Docker image. To see what is included in the image, you can check its GitHub project, or pull and inspect the image itself": github.com/GoogleCloudPlatform/nodejs-dockerMulholland
Have you found anything ? I need to do this as wellChampignon
@GeoffreyHug Nops, havn't found any solution to this.Kalila
@Kalila I found this github.com/ripjar/passport-client-cert. I didn't have time to look into it thoroughly but I think it might do the job.Champignon

© 2022 - 2024 — McMap. All rights reserved.