Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Option or Argument to disable "Loading cached token" message #58

Open
Mike-Hanna opened this issue Jan 20, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Mike-Hanna
Copy link

The logs in RConnect/production servers get cluttered with the "Loading cached token" message when the use_cache argument is set to TRUE. Having the option to disable this message would be great for RConnect/production content. Thank you!

@hongooi73
Copy link
Collaborator

hongooi73 commented Jan 24, 2022

Hmm, I think you actually want to log this. Authentication snafus are a common source of security holes, so knowing exactly where your credentials are coming from seems valuable. If the logs get annoying, set use_cache=FALSE. It could be argued that in an unattended pipeline, the cache isn't that useful anyway.

@hongooi73 hongooi73 added the enhancement New feature or request label Jan 25, 2022
@Mike-Hanna
Copy link
Author

@hongooi73 Is there a token request limit if we set use_cache=FALSE for multiple pipelines running at the same time? or even for a single pipeline that requests a token inside a for loop (I'm not a big fan of for loops either, but it has certain use cases).

@hongooi73
Copy link
Collaborator

I'm not aware of any rate limits for the AAD endpoints, and I've called them intensively as part of AzureAuth testing. You may want to talk to your friendly local MS rep about this though; I'm not really an AAD expert.

@marcolindner-de
Copy link

If desired you could use this workaround:

token_app <- AzureAuth::get_azure_token(
  resource = "https://storage.azure.com/.default offline_access"),
  version = 2,
  tenant = "<tenant_id>",
  app = "<app_id>",
  auth_type = "device_code",
  use_cache = TRUE
) |> pkgcond::suppress_messages(pattern = "Loading cached token")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants