get_creds_from_server: Generate a new token from Lufthansa.

Description Usage Arguments Value See Also

Description

A token is obtained in the last step of the OAuth2.0 authentication process whereby a client ID and secret are exchanged with the authorizing server. This function helps perform this last step of the exchange. LufthansaR API tokens expire after a while so the expiry time is also stored.

To avoid having to type your id and secret into the terminal which might be saved into a history file, it is recommended that these be stored in a .Renviron file which is loaded by R before the start of every session. By default, this function looks for the following string variables in the system environment:

LUFTHANSA_API_CLIENT_ID

a string

LUFTHANSA_API_CLIENT_SECRET

a string

Usage

1
2
get_creds_from_server(client_id = Sys.getenv("LUFTHANSA_API_CLIENT_ID"),
  client_secret = Sys.getenv("LUFTHANSA_API_CLIENT_SECRET"))

Arguments

client_id

The client ID used to register for using the API.

client_secret

The secret provided during registration.

Value

the token information as a list with components token and expiry.

See Also

Other token handling functions: add_creds_to_cache, add_creds_to_env, get_creds_from_cache, get_creds_from_env


peter0083/LufthansaR documentation built on May 21, 2019, 12:05 p.m.