if (FALSE) {
# without any arguments, this will create a client using your AAD organisational account
az <- create_graph_login()
# retrieve the login in subsequent sessions
az <- get_graph_login()
# this will create an Microsoft Graph client for the tenant 'mytenant.onmicrosoft.com',
# using the client_credentials method
az <- create_graph_login("mytenant", app="{app_id}", password="{password}")
# you can also login using credentials in a json file
az <- create_graph_login(config_file="~/creds.json")
# creating and obtaining a login with specific scopes
create_graph_login("mytenant", scopes=c("User.Read", "Files.ReadWrite.All"))
get_graph_login("mytenant", scopes=c("User.Read", "Files.ReadWrite.All"))
# to use your personal account, set the tenant to one of the following
create_graph_login("9188040d-6c67-4c5b-b112-36a304b66dad")
create_graph_login("consumers") # requires AzureAuth 1.3.0
}
Run the code above in your browser using DataLab