pub fn request_token(
    api_key: &str,
    identity_url: Option<&Url>,
    allow_insecure: bool,
    allow_invalid_certs: bool
) -> Result<AccessToken>
Expand description

Makes a request against the /token endpoint of FlightDeck using the discovered API key and returns the short lived Access token response.

Subject to change, but the access token is only good for 60 seconds (the raw JWT under the token field contains iat, nbf and exp fields to determine the exact length of time the token is valid for. However we don’t want to introspect the token if possible as it’s not stable)

WARNING: allow_insecure enables using HTTP endpoints, but only has an affect when compiled with feature allow_insecure_urls. It is ignored otherwise, it is ignored otherwise.