Skip to main content

Module token

Module token 

Source
Expand description

Token pairs and their refresh over the token endpoint.

A refresh rotates the pair: the old access and refresh tokens stop working once the server has answered, so the caller must store the new pair before doing anything else with it.

The endpoint is queried with a single HTTP GET over the same TLS stack the connection uses; the reply is a small JSON document.

Structs§

TokenPair
Access token together with the refresh token that renews it.

Functions§

parse_token_response
Reads a token pair from the JSON document the token endpoint answers with.
refresh_over_http
Exchanges a refresh token for a new pair at the token endpoint of the configuration.