Usage Guideline + Authentication
6min
authentication litmus edge the sdk uses the oauth2 authentication framework for generating an oauth2 key for your litmus edge instance please see our documentation https //docs litmus io/litmusedge/product features/system/access control/tokens/create api token generating a oauth 2 litmus edge token navigate to system > access control > tokens in your litmus edge client press the plus icon next to api credentials and select "oauth 2 0 client" (if your instance only has api key than this version is unsupported for the sdk) grant your token admin permissions or equivalent (lesser permissions are supported but may limit functionality of the sdk) copy the client id and client secret configuration configuration for the litmus sdk uses dotenv variables to control settings this can be done with a env file in the root directory system variables using export {varaible name}={value} note this only creates local system variables and will only work for the current shell instance configure your instance by running the following in your shell export edge url={url} export edge api client id={client id} export edge api client secret={client secret} (this method requires python dotenv as an external dependency) install the python dotenv library eg pip install python dotenv create a env variable with the following parameters edge url={url} edge api client id={client id} edge api client secret={client secret} litmus edge manager litmus edge manager uses the lem bridge which only requires a normal api token generating an api token for the litmus edge manager bridge in the litmus edge manager admin console navigate to settings > tokens > new configure a token and enable the edge api bridge (this will allow the sdk to use the lem bridge to communicate with individual edge devices) under token scope select which projects the token will have access to create token and copy it configuration to configure authorization on for the sdk, do any of the following using the cli configure your instance by running the following in the cli export use lem bridge=true export edge manager url={url of edge manager} export edge manager project id={project id} export edge manager device id={device id} export edge api token={api token of lem} loading from env see loading from env under litmus edge configuration