Hyper API¶
OAuth2 Device Flow implementation for Hyper service.
Functions¶
InitiateDeviceFlow / initiate_device_flow¶
Initiates the device authorization flow for Hyper.
Returns: Device code response
PollForToken / poll_for_token¶
Polls for access token after user authorization.
Parameters:
- device_code: Device code from initiation
- on_success: Optional callback on successful authentication
Returns: Access token
IntrospectToken / introspect_token¶
Introspects an access token to check its validity (RFC 7662).
Parameters:
- token: Access token to introspect
Returns: Token introspection response
Response Fields:
- active (bool): Token validity status
- scope (string): Token scope
- exp (int): Expiration timestamp
- iat (int): Issued at timestamp
Example:
BaseURL / base_url¶
Returns the configured Hyper API base URL.
Default: https://api.hyper.io
Environment Variable: HYPER_BASE_URL
Example:
Endpoints¶
| Endpoint | Purpose |
|---|---|
/oauth/device |
Device code initiation |
/oauth/token |
Token exchange |
/oauth/introspect |
Token introspection |
Configuration¶
Custom Base URL¶
Configure via environment variable:
Error Handling¶
Common errors:
invalid_token: Token is invalid or expiredconnection_error: Cannot reach Hyper servicetimeout: Request exceeded 30 second limit