Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetIDToken = func(ctx context.Context) (string, error) { creds, err := google.FindDefaultCredentials(ctx, scopes...) if err != nil { return "", fmt.Errorf("failed to find default credentials: %w", err) } token, err := creds.TokenSource.Token() if err != nil { return "", err } idToken, ok := token.Extra("id_token").(string) if !ok { return "", fmt.Errorf("token response did not contain an id_token") } return idToken, nil }
GetIDToken retrieves an identity token for the given audience using Google Cloud credentials.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.