auth

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package auth implements the four headless OAuth grants Geiger supports. Each is exactly one POST to a module-declared token endpoint — the only auth POST Geiger makes by design — returning a bearer (and sometimes an instance URL).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthExtra

func BasicAuthExtra(clientID, clientSecret string) map[string]string

BasicAuthExtra returns a header map adding HTTP Basic auth, for token endpoints that require client auth in the header rather than the body (e.g. MongoDB Atlas SA, some OAuth servers).

func ClientCredentials

func ClientCredentials(ctx context.Context, c *recon.Client, tokenURL, clientID, clientSecret string, extra url.Values) (module.Token, error)

ClientCredentials performs the client_credentials grant (Entra, Auth0, Okta-OAuth, Atlas SA, …). Pass scope/audience/resource as needed via extra.

func Exchange

func Exchange(ctx context.Context, c *recon.Client, tokenURL string, form url.Values, hdrs map[string]string) (module.Token, error)

Exchange performs an arbitrary single token-endpoint POST (form body + extra headers, e.g. Basic client auth) and returns the resulting bearer. It backs the non-standard grants (Zoom account_credentials, …).

func JWTBearer

func JWTBearer(ctx context.Context, c *recon.Client, tokenURL, assertion string, extra url.Values) (module.Token, error)

JWTBearer performs the urn:ietf:params:oauth:grant-type:jwt-bearer grant (GCP service accounts, Salesforce JWT, Snowflake key-pair). assertion is the pre-signed RS256 JWT.

func Password

func Password(ctx context.Context, c *recon.Client, tokenURL, clientID, clientSecret, username, password string, extra url.Values) (module.Token, error)

Password performs the password grant (legacy ROPC, e.g. some Salesforce/Okta integrations). Included for completeness of the headless grant set.

func RefreshToken

func RefreshToken(ctx context.Context, c *recon.Client, tokenURL, clientID, clientSecret, refreshToken string, extra url.Values) (module.Token, error)

RefreshToken performs the refresh_token grant (GCP user creds, GitHub App refresh, Salesforce, …).

Types

This section is empty.

Jump to

Keyboard shortcuts

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