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

Improve documentation for password protected pem files #62

Open
aapeebles opened this issue Mar 16, 2022 · 1 comment
Open

Improve documentation for password protected pem files #62

aapeebles opened this issue Mar 16, 2022 · 1 comment

Comments

@aapeebles
Copy link

Hello!
I have a a registered app on an enterprise account.
My Dev team uses both R and Python.
I'm trying to adapt the Python code to use AzureAuth, but I'm hitting a wall with documentation and error messages.

Variables I have:

  • Tenant ID
  • Client ID (app id)
  • Thumbprint
  • pem file
  • password to unlock pem file

When I try the code below (trying both the absolute file name and the path to the file) I get this error:
Error in read_input(file) : file must be connection, raw vector or file path

It's also unclear where to enter the pem password or the thumbprint.

Could you please provide a vignette for a password protected pem file and thumbprint?


resource <-"https://graph.microsoft.com/.default"
cert_path <- "C:/Users/<username>/Documents/repo_work/api_r_demo/CHCAnalyticsAutomation.pem"

get_azure_token(resource, 
                           creds$TENANT_ID,  
                           creds$CLIENT_ID,
                           certificate=cert_path, 
                           auth_type="client_credentials")
@hongooi73
Copy link
Collaborator

Hi, it's been some time since I looked at cert authentication, but:

  • make sure your file exists at the path given
  • a PEM file should look like this:
-----BEGIN PRIVATE KEY-----
MIIEvQ...
...
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDKD...
...
-----END CERTIFICATE-----

Ie, it should have both the public and private keys in a text format.

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

No branches or pull requests

2 participants