question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClientBuilder::setPrivateKey should have a variant where I can set the pem-content directly

See original GitHub issue

Right now, it allows me to set a String which contains a hard file-system-path. This is not appropriate in many cloud-native environments where configuration-properties like this are loaded from a service, such as AWS Secrets Manager.

Also, it is inconvenient for the pem file to have to be in a physical file. In containerized cloud-native environments access to a filesystem is not as normal as it was in the old days.

It will also be much more flexible this way. Maybe passing an InputStream is even better.

So please allow the pem content to be set something like this:


String pemContent = readPem();// so this I take care of myself
var client = Clients.builder()
                .setPrivatePem(pemContent) // pass the whole pem, avoid reading the FS
                .setOrgUrl("https://" + oktaDomain)  // e.g. https://dev-123456.okta.com
                .setAuthorizationMode(AuthorizationMode.PRIVATE_KEY)
                .setClientId("my-id")
                .setScopes(Set.of("okta.users.read"))
                .setCacheManager(Caches.newDisabledCacheManager())
                .build();

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hanswesterbeekcommented, Nov 19, 2020

If I provide that PR, how long until you merge and release? 😃

0reactions
hanswesterbeekcommented, Dec 16, 2020

Nice!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting SecKey from a pem file | Apple Developer Forums
I have a pem file with a public key that was creted by a server and I need to import this key to...
Read more >
how to get private key from PEM file? - Stack Overflow
To get the bytes for either a certificate or a key from the PEM file the following method will work, regardless of the...
Read more >
How to Read PEM File to Get Public and Private Keys
Learn how to read public and private keys from PEM files. ... It's a binary encoding, and the resulting content can't be viewed...
Read more >
Convert a Certificate File to the PEM Format Required for Pod ...
You must convert your non-PEM-format file into PEM format and create a single PEM file that contains the full certificate chain plus private...
Read more >
What is a Pem file and how does it differ from other OpenSSL ...
The returned certificate is the public certificate (which includes the public key but not the private key), which itself can be in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found