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] Use environment variable for password for PEM #22782

Merged
merged 5 commits into from
Aug 2, 2022

Conversation

mpodwysocki
Copy link
Contributor

@mpodwysocki mpodwysocki commented Aug 2, 2022

Packages impacted by this PR

  • [identity]

Issues associated with this PR

Describe the problem that is addressed by this PR

Adds support for the AZURE_CLIENT_CERTIFICATE_PASSWORD environment variable to allow a PEM certificate with a password.

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

As documented in the MSAL Library for creating certificate credentials, we have to decode the private key with the following code:

const privateKeyObject = crypto.createPrivateKey({
    key: privateKeySource,
    passphrase: "password", // enter your certificate passphrase here
    format: 'pem'
});

const privateKey = privateKeyObject.export({
    format: 'pem',
    type: 'pkcs8'
});

Are there test cases added in this PR? (If not, why?)

  • Added a PEM with password and added test for checking for password.

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

@mpodwysocki mpodwysocki enabled auto-merge (squash) August 2, 2022 18:54
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-identity

@mpodwysocki mpodwysocki merged commit fbee570 into Azure:main Aug 2, 2022
@mpodwysocki mpodwysocki deleted the feat/identity-env branch August 2, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants