There's an open feature request for Metabase to support IAP. I took a stab at it, and have a Clojure implementation of the steps detailed in Securing your app with signed headers (i.e. verify token header, verify token payload, retrieve user identity).
But this question isn't necessarily specific to Metabase. The general idea is to replace Google Sign-In and only use only IAP signed headers for authentication and user creation in an application on Google App Engine (specifically, GAE flex environment).
The "problem" is that the user identity information from the IAP token looks like: {"email":"alice@example.com","sub":"accounts.google.com:118133858486581853996"}
. I also came across Using special URLs, but this returns something like: {"email":"accounts.google.com:USER_EMAIL","sub":"accounts.google.com:118133858486581853996"}
.
With a Google Sign-In token, I can obtain values for given_name
and family_name
along with email
, which means I can fetch-or-create a valid Metabase user. Is there a way to get the first and last name via the JWT sub
, (i.e. accounts.google.com:118133858486581853996
)?