tokenRequest

suspend fun tokenRequest(formParams: Map<String, String>, nonce: String? = null, maxAge: Int? = null): ERROR CLASS: Symbol not found for Result<com/okta/authfoundation/client/TokenInfo>

Performs a token endpoint request with the given form parameters.

Posts formParams to the token endpoint, parses the response into TokenInfo, and runs full validation via processTokenResponse (ID token, access token, device secret validation + event emission).

This is the KMP equivalent of the Android @InternalAuthFoundationApi tokenRequest method. Flow classes should call this instead of making their own HTTP calls to the token endpoint.

Return

Result.success with the validated TokenInfo, or Result.failure with:

Parameters

formParams

the form parameters for the token request (e.g., grant_type, client_id, etc.).

nonce

the nonce sent with the authorization request, if applicable.

maxAge

the max_age sent with the authorization request, if applicable.