browser

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package browser provides browser-based authentication functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsChromeAvailable

func IsChromeAvailable() bool

IsChromeAvailable checks if Chrome or Chromium is available on the system. Returns true if Chrome/Chromium is found at common installation paths.

Types

type AuthResult

type AuthResult struct {
	Cookies  []*http.Cookie
	FinalURL string
	Username string
}

AuthResult contains the result of browser-based authentication.

func AuthenticateWithChrome

func AuthenticateWithChrome(targetURL string, authHostname string, timeout time.Duration, env map[string]string) (*AuthResult, error)

AuthenticateWithChrome opens Chrome, navigates to the target URL, waits for authentication to complete, and extracts cookies from the authenticated session.

The user must complete authentication (including Touch ID) in the browser window. The function waits until the browser navigates away from the auth hostname, indicating successful authentication. env is a map of environment variables to set for the browser process (e.g. KRB5CCNAME).

Jump to

Keyboard shortcuts

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