Auth library to verify OpenID Connect ID Token from GCP services.
- When you need to authenticate requests from cloud scheduler on Cloud Run which allows public access
- Assuming you want to verify requests from the above Cloud Scheduler.
issuerEmail := "cloud-scheduler@foo.iam.gserviceaccount.com"
aud := "Ais5cie5"
if err := gcpauth.VerifyIDToken(ctx, issuerEmail, &gcpauth.Config{Aud: aud}); err != nil {
// return 401
}
// continue