Description Usage Arguments Examples
See examples on how to give additional remote users access.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | generate_pem(
userid,
role = c("user", "admin"),
password = rand_string(8),
username = "Unknown",
pem_file = tempfile(),
dry_run = FALSE,
overwrite = FALSE,
force = FALSE
)
my_userid()
add_pem(pem_file, password = "", username = get_username())
|
userid |
user's ID |
role |
role of the user; choices as 'user' (default) and 'admin' |
password |
a secret code to encode/decode the private key. This is not
the user's password. It is just some code that only is shared between the
system admin and the target user. If |
username |
the user's name |
pem_file |
where the encrypted key should be saved to |
dry_run |
to display the result instead of actually adding the user to the database |
overwrite |
whether to overwrite the private keys if the user already exists in the database |
force |
whether to force adding the user. This is usually used with
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # ----------- If you are the server admin -----------
# The server admin need to get end user's user ID and a user name
# To add the user,
# assuming the user ID is as follows (I created a fake one)
userid <- "22dbdc9e876a74a768c15e03c7356780"
username <- "Alice"
pem <- generate_pem(userid = userid, username = username, force = TRUE)
# Now share the passcode and pen_file to the end user
# password is
pem$password
# encoded pem_file is stored at
pem$pem_file
# ---------- If you are the end user ----------
# Send your user ID and your preferred user name to the system admin
# user ID can be obtained from `my_userid()`
my_userid() # something like "22dbdc9e876a74a768c15e03c7356780" (32-length)
# You will get a passcode and a pem file from the system admin
# (see variable `pem` in the previous example)
add_pem(pem$pem_file, pem$password, username = 'Alice')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.