Skip to main content

Module xai_oauth

Module xai_oauth 

Structs§

DeviceCodeDiscovery
DeviceCodeStart
OAuthDiscovery
PkceState
PKCE state container for OAuth2 authorization code flow.

Constants§

XAI_OAUTH_CLIENT_ID
XAI_OAUTH_DISCOVERY_URL
XAI_OAUTH_ISSUER
XAI_OAUTH_REDIRECT_URI
XAI_OAUTH_SCOPE

Functions§

build_authorize_url
exchange_code_for_tokens
extract_account_id_from_jwt
fetch_device_code_discovery
fetch_oauth_discovery
generate_pkce_state
Generate a new PKCE state with cryptographically random values. Creates a code verifier, derives the S256 code challenge, and generates a random state parameter for CSRF protection.
import_grok_auth_profile
parse_code_from_redirect
poll_device_code_tokens
receive_loopback_code
refresh_access_token
restore_pkce_state
start_device_code_flow