## Example of setting and clearing email/password, API key, and Session key
# library(Rlabkey)
labkey.setDefaults(email="testing@localhost.test", password="password")
## Functions invoked at this point respect the role assignments and
## other authorizations of the specified user
## A user can create an API key via the LabKey UI and set it as follows:
labkey.setDefaults(apiKey="abcdef0123456789abcdef0123456789")
## Functions invoked at this point respect the role assignments and
## other authorizations of the user who created the API key
## A user can create a session key via the LabKey UI and set it as follows:
labkey.setDefaults(apiKey="0123456789abcdef0123456789abcdef")
## Functions invoked at this point share authorization
## and session information with the user's browser session
labkey.setDefaults() # called without any parameters will reset/clear the environment variables
Run the code above in your browser using DataLab