Module xai_oauth
Structs§
- Device
Code Discovery - Device
Code Start - OAuth
Discovery - Pkce
State - PKCE state container for OAuth2 authorization code flow.
Constants§
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