Skip to main content

request_token

Function request_token 

Source
pub async fn request_token(
    configuration: &Configuration,
    key_name: &str,
    request_token_request: RequestTokenRequest,
    x_ably_version: Option<&str>,
) -> Result<TokenDetails, Error<RequestTokenError>>
Expand description

Exchange a token request for an Ably Token (TokenDetails). Two request forms are accepted: - A signed TokenRequest (carries a mac computed with the API key secret). No Authorization header is required — the mac is the credential. This is how an untrusted client redeems a request its server signed. - An unsigned TokenParams body. Requires HTTP Basic authentication with the API key; Ably signs the token server-side. The effective capability of the returned token is the intersection of the requested capability and the issuing key’s own capability; an empty intersection fails the request.