Learn R Programming

motherduck (version 0.2.0)

list_md_user_tokens: List a MotherDuck user's tokens

Description

Retrieves all active authentication tokens associated with a specific MotherDuck user account, returning them as a tidy tibble.

Usage

list_md_user_tokens(user_name, motherduck_token = "MOTHERDUCK_TOKEN")

Value

A tibble with two columns:

  • token_settings: metadata fields associated with each token.

  • token_values: corresponding values for those fields.

Arguments

user_name

A character string specifying the MotherDuck user name whose tokens should be listed.

motherduck_token

Character. Either the name of an environment variable containing your MotherDuck access token (default "MOTHERDUCK_TOKEN") or the token itself.

Details

This function queries the MotherDuck REST API endpoint https://api.motherduck.com/v1/users/{user_name}/tokens to list the tokens available for the specified user.

It uses the provided or environment-resolved motherduck_token for authorization. If motherduck_token is not explicitly provided, the function attempts to resolve it from the MOTHERDUCK_TOKEN environment variable The current authenticated user is displayed via show_current_user() for verification.

See Also

Other db-api: configure_md_user_settings(), create_md_access_token(), create_md_user(), delete_md_access_token(), delete_md_user(), list_md_active_accounts(), list_md_user_instance(), show_current_user()

Examples

Run this code
if (FALSE) {
# List tokens for a specific user
tokens_tbl <- list_md_user_tokens(user_name = "alejandro_hagan")
print(tokens_tbl)
}

Run the code above in your browser using DataLab