This commit is contained in:
hong-revo 2019-02-12 21:44:46 +11:00
Родитель c61a2218fa
Коммит 79a6102b81
3 изменённых файлов: 177 добавлений и 6 удалений

Просмотреть файл

@ -40,7 +40,7 @@ get_azure_token("myresource", "mytenant", "app_id", auth_type="device_code")
# obtain a token using client_credentials
# supply credentials in password arg
get_azure_token("myresource", "mytenant", "app_id",
password="mypassword", auth_type="client_credentials")
password="client_secret", auth_type="client_credentials")
# can also supply a client certificate, as a string
get_azure_token("myresource", "mytenant", "app_id",
@ -53,7 +53,7 @@ get_azure_token("myresource", "mytenant", "app_id",
# obtain a token using resource_owner
# supply credentials in username and password args
get_azure_token("myresource", "mytenant", "app_id",
password="mypassword", auth_type="resource_owner")
username="myusername", password="mypassword", auth_type="resource_owner")
```
If you don't specify the method, `get_azure_token` makes a best guess based on the presence or absence of the other authentication arguments, and whether httpuv is installed.

Просмотреть файл

@ -68,7 +68,7 @@ get_azure_token("myresource", "mytenant", "app_id", auth_type="device_code")
# obtain a token using client_credentials
# supply credentials in password arg
get_azure_token("myresource", "mytenant", "app_id",
password="mypassword", auth_type="client_credentials")
password="client_secret", auth_type="client_credentials")
# can also supply a client certificate, as a string
get_azure_token("myresource", "mytenant", "app_id",
@ -81,7 +81,7 @@ get_azure_token("myresource", "mytenant", "app_id",
# obtain a token using resource_owner
# supply credentials in username and password args
get_azure_token("myresource", "mytenant", "app_id",
password="mypassword", auth_type="resource_owner")
username="myusername", password="mypassword", auth_type="resource_owner")
```
If you don't specify the method, `get_azure_token` makes a best guess based on the presence or absence of the other authentication arguments, and whether httpuv is installed.
@ -94,7 +94,7 @@ get_azure_token("myresource", "mytenant", "app_id")
## Caching
AzureAuth caches tokens based on all the inputs to `get_azure_token`, as listed above. It defines its own directory for cached tokens, using the rappdirs package. On recent Windows versions, this will usually be in the location `C:\\Users\\(username)\\AppData\\Local\\AzureR`. On Linux, it will be in `~/.config/AzureR`, and on MacOS, it will be in `~/Library/Application Support/AzureR`. Note that a single directory is used for all tokens, and the working directory is not touched (which significantly lessens the risk of accidentally introducing cached tokens into source control).
AzureAuth caches tokens based on all the inputs to `get_azure_token`, as listed above. It defines its own directory for cached tokens, using the rappdirs package. On recent Windows versions, this will usually be in the location `C:\Users\(username)\AppData\Local\AzureR`. On Linux, it will be in `~/.config/AzureR`, and on MacOS, it will be in `~/Library/Application Support/AzureR`. Note that a single directory is used for all tokens, and the working directory is not touched (which significantly lessens the risk of accidentally introducing cached tokens into source control).
To list all cached tokens on disk, use `list_azure_tokens`. This returns a list of token objects, named according to their MD5 hashes.
@ -108,7 +108,7 @@ list_azure_tokens()
# delete a token
delete_azure_token("myresource", "mytenant", "app_id",
password="mypassword", auth_type="client_credentials")
password="client_credentials", auth_type="client_credentials")
```
## More information

171
vignettes/token.html Normal file

Различия файлов скрыты, потому что одна или несколько строк слишком длинны