oauth2

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

connect-oauth2

Go Reference

Utilities to call Connect services in Go using OAuth2 authentication.

Install

go get github.com/altipla-consulting/connect-oauth2

Usage

Authenticate with the default ID token to call Cloud Run services.

var client = fooconnect.NewFooServiceClient(
  http.DefaultClient,
  "https://www.example.com",
  connect.WithInterceptors(oauth2.GoogleIDToken(env.IsProduction(), "https://www.example.com")),
)

Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using make gofmt.

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoogleIDToken

func GoogleIDToken(isProduction bool, scope string) connect.ClientInterceptor

GoogleIDToken adds an ID token as a bearer header to the requests. It needs to check for production environments to avoid trying to generate an id token in the local computer where it's not available.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址