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

[Identity] Add allow_logging_account_identifiers to the credential options #23203

Closed
sadasant opened this issue Feb 24, 2022 · 1 comment
Closed
Assignees
Milestone

Comments

@sadasant
Copy link
Contributor

sadasant commented Feb 24, 2022

This is a copy of the same issue in JS: Azure/azure-sdk-for-js#20502

Draft PR in JS: Azure/azure-sdk-for-js#20516


While investigating what sensitive logging to add to our credentials, we have determined that the most useful information we could log are the account identifiers after retrieving a token. This issue describes a flexible approach to add support to log the account information on our credentials.

Tasks:

  1. Add allow_logging_account_adentifiers to the options of the credentials’ constructors.
  2. Retrieve the account identifiers after authenticating.
  • Parse the first section of the access token after the . (which can be obtained with access_token.split(“.”)[1]), then extract the following properties: appid, upn, tid, oid.
  1. After a token is retrieved and the identifiers have been extracted, if allowLoggingAccountIdentifiers was set in the constructor of the credential, log a message similar to the following: [Authenticated account] Client ID: ${appid}. Tenant ID: ${tid}. User Principal Name: ${upn || "No User Principal Name available"}. Object ID (user): ${oid}.

What do you think? Feedback appreciated.

@sadasant sadasant added this to the [2022] April milestone Feb 24, 2022
@sadasant sadasant self-assigned this Feb 24, 2022
@sadasant sadasant changed the title [Identity] Add allowLoggingAccountIdentifiers to the credential options [Identity] Add allow_logging_account_identifiers to the credential options Feb 24, 2022
@xiangyan99
Copy link
Member

#23658

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants